Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / January 2006

Tip: Looking for answers? Try searching our database.

Submitting form

Thread view: 
duncan.lori@gmail.com - 08 Jan 2006 15:27 GMT
Hi Everyone

I have a question which I'm feeling ashamed asking any of my
colleagues, please help.

My basic challenge is to submit a form and access the values from
portlet or for that matter any java class. I have a jsp page from which
I have to submit upto 20 fields.

So i used the <jsp:useBean tag as follows

    <jsp:useBean id="person"
        class="com.tes.forms.FormBean"
        scope="request">
        <jsp:setProperty name="person" property="*" />
    </jsp:useBean>

Now how do I access the bean from the servlet or any other java class

I tried using

Person person = request.getAttribute("person"); , it doesn't work  ,
please help
Chris Smith - 09 Jan 2006 19:26 GMT
> So i used the <jsp:useBean tag as follows
>
[quoted text clipped - 10 lines]
> Person person = request.getAttribute("person"); , it doesn't work  ,
> please help

You've specified request scope, meaning that those values will only last
for the remainder of this request.  It's unlikely that, after you reach
this JSP, you'll ever get back to a servlet again in this request.

A band-aid for the problem might be to change the scope to session...
but that's just a band-aid.  You should rethink your design.  In fact,
don't use jsp:setProperty.  It's a symptom of poor design.

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.