Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Character.parseChar()

843841Apr 24 2005 — edited May 19 2009
Hi,

I have written a Servlet to get my user's information using a session bean with the following:

String userName = request.getParameter( "j_username");
if((userName != null) && !(userName.equals(""))) {
try{
ejb.userMethodRemote user = lookupuserMethod();
out.println("User's info for user. " + userName + ": " + user.getUserInfo(
Character.parseChar(userName)));
}catch(javax.ejb.FinderException ex){
out.println("Customer with nr. " + userName +" not found");
}
}

where my business method in my session bean is:

public String getUserInfo(char user_name) throws javax.ejb.FinderException {
ejb.UsersLocal user = usersHome.findByPrimaryKey(new Character(user_name));
return "First Name: " + user.getNameFirst() + "Last Name: " + user.getNameLast() + "Address: " + user.getAddrLn1()
+ "City: " + user.getCity() + "E-mail: " + user.getEmail();
}

In my servlet I get a "cannot find symbol" error with:

Character.parseChar(userName)

Could someone tell me how to resolve this problem, please???

Thank you,

(sorry if the it looks quite stupid...I am new to java!!)

rkbacha
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 16 2009
Added on Apr 24 2005
13 comments
26,244 views