pass object from jsp to controller command
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Commerce suite > pass object from jsp to controller command




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    pass object from jsp to controller command  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-19-05 11:11 PM

How do I pass an object from jsp to a controller command or from jsp to jsp
Thanks






[ Post a follow-up to this message ]



    Re: pass object from jsp to controller command  
John


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-19-05 11:11 PM

Hi,

Please note that these are educated guesses as to how you might be
able to accomplish the 2 tasks.  You can either try some of these
suggestions or perhaps wait for a more experienced developer to post a
response.

I am not sure if this would work but you should be able to save the
object to the session from within the JSP and then access that object
within the controller command.  If you are calling the controller
command from within a JSP scriptlet, by using the
ControllerCommandInvokerDataBean, then you should be able to add the
object to the request properties that you set for the command.

If a jsp is including another jsp then should be able to just add the
object to the request before including the other jsp.  Then within the
included JSP you should be able to pull the object off of the request.

If by "from jsp to jsp" you mean an html link in the content generated
by 1 jsp that points to another jsp then I am not sure how you would
do this other than by saving the object to the session in jsp 1 and
then retrieving it from the session in jsp 2.

Hopefully this is somewhat helpful.  Perhaps one of the more
experienced readers of this newsgroup might be able to provide some
better guidance.

Good Luck,
John

On Tue, 19 Apr 2005 10:52:12 EDT, <scheng@sharedvision.com> wrote:

>How do I pass an object from jsp to a controller command or from jsp to jsp
>Thanks






[ Post a follow-up to this message ]



    Re: pass object from jsp to controller command  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-19-05 11:11 PM

Thanks for your reply.

I am not allow to use the session object.  And I am trying need to pass an o
bject from JSP to servlet using the post method.

Thanks






[ Post a follow-up to this message ]



    Re: pass object from jsp to controller command  
John


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-19-05 11:11 PM

If the object is serializable could you serialize it, add it to a
hidden field as text  and then in the servlet get the value of that
hidden field as a string and then deserialize back to an object?  This
is just a thought based on very little knowledge about serialization.
I am also not sure about whether this violates any "best practices"
rules but my guess is that it might.

- John

On Tue, 19 Apr 2005 12:25:26 EDT, <scheng@sharedvision.com> wrote:

>Thanks for your reply.
>
>I am not allow to use the session object.  And I am trying need to pass an 
object from JSP to servlet using the post method.
>
>Thanks






[ Post a follow-up to this message ]



    Re: pass object from jsp to controller command  
George Niece


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-19-05 11:11 PM

What kind of object?

Do you work for Drake Philbrook, by chance?

<scheng@sharedvision.com> wrote in message
news:1244248791.1113922364289.JavaMail.wassrvr@ltsgwas007.sby.ibm.com...
> How do I pass an object from jsp to a controller command or from jsp to
jsp
> Thanks
>







[ Post a follow-up to this message ]



    Re: pass object from jsp to controller command  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-19-05 11:11 PM

It's a search resultset.  yes I work for Drake.  You know him? What a coinci
dence.
thanks





[ Post a follow-up to this message ]



    Re: pass object from jsp to controller command  
George Niece


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-19-05 11:11 PM

I should have asked this before, but how big is the object?

<scheng@sharedvision.com> wrote in message
news:472349423.1113947022259.JavaMail.wassrvr@ltsgwas007.sby.ibm.com...
> It's a search resultset.  yes I work for Drake.  You know him? What a
coincidence.
> thanks







[ Post a follow-up to this message ]



    Re: pass object from jsp to controller command  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-05 10:53 PM

It's pretty big, so we don't want to store that in the session.

Thanks





[ Post a follow-up to this message ]



    Re: pass object from jsp to controller command  
George Niece


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-05 10:53 PM

I can definitely understand the desire not to make the session too big,
however, as long as you are removing the attribute upon arriving at the
ControllerCmd invoked, what is the issue with using it in this instance
where it appears appropriate.  If the resultset is not database derived then
I think you are best off using session.  If the resultset is derived from
database queries then just pass the appropriate row ids rather than the full
resultset and retrieve the appropriate data in the ControllerCmd using those
row ids.

Having said the above, if the data is not derived from the database and is
going to be used by multiple chained commands or page flows then it should
be serialized in the database and retrieved at each access point.


<scheng@sharedvision.com> wrote in message
news:1028880677.1114003520499.JavaMail.wassrvr@ltsgwas007.sby.ibm.com...
> It's pretty big, so we don't want to store that in the session.
>
> Thanks







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:40 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register