• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help with JSP tag

 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RegistrationForm regform = (RegistrationForm)form;
request.setAttribute("fullname",regform );
inside my jsp page

Welcome!
<%= ((org.apache.struts.company.RegistrationForm)request.getAttribute("fullname")).getfirstName()%>  
<%= ((org.apache.struts.company.RegistrationForm)request.getAttribute("fullname")).getlastName()%>

This works.., but I would like to know how to use jsp: useBean tag or any other jsp tag to do the above. appreciate help.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"shah_rah", you have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using JSP 2.0 (you did not include version information as requested by forum guidelines), it's as easy as:

${fullname.firstName}

${fullname.lastName}
 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i find out the JSP version? I am using eclipe 3.2.1 and I downloaded some plugins. pls help.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The IDE you use is irrelevant. What container are you using with it? Tomcat? If so, which version?

Knowing what versions of Servlets and JSP you are using is something you need to know before writing a single character of code.
[ January 20, 2007: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic