aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Regarding Request Parameter Passing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Regarding Request Parameter Passing" Watch "Regarding Request Parameter Passing" New topic
Author

Regarding Request Parameter Passing

Amol Lekurwale
Greenhorn

Joined: Jun 12, 2008
Posts: 6
In the book of Sierra for SCWCD, it is written that when a jsp is included/forwarded, parameters can be sent, and are sent as request parameters. My question is how request 'parameters' are 'set' in this case?
How will the converted servlet look like?
Maneessh saxena
Ranch Hand

Joined: Oct 03, 2006
Posts: 125
Hi Amol,

parameters are written in web.xml and are deploy time constants and . We can get parameters but we can't set the parameters as in case of Attributes...

hope this help.


SCJP 1.4, SCWCD 1.5
Amol Lekurwale
Greenhorn

Joined: Jun 12, 2008
Posts: 6
Originally posted by raunak saxena:
Hi Amol,

parameters are written in web.xml and are deploy time constants and . We can get parameters but we can't set the parameters as in case of Attributes...

hope this help.


I meant parameters which are sent to the included/forwarded jsp (using RequestDispatcher),not form parameters. It is mentioned in the book that <jsp : param name="xyz" value="pqr"> go as request parameter, which are retrived in the forwarded/included as request.getParameter("xyz");
What goes on in the servlet, to which the JSP's are converted
[ June 13, 2008: Message edited by: Amol Lekurwale ]
Srinu Nanduri
Ranch Hand

Joined: Mar 20, 2006
Posts: 42
The container implementation might have parameter setters that are accessible to the translated JSP's Servlet class.


SCJP, SCWCD
Jan Sterk
Ranch Hand

Joined: Jun 06, 2008
Posts: 139
Originally posted by Amol Lekurwale:
In the book of Sierra for SCWCD, it is written that when a jsp is included/forwarded, parameters can be sent, and are sent as request parameters...


On what page?


SCJP 1.4 (81%)<br />SCWCD 5 (95%)
Antonio Tercero
Ranch Hand

Joined: Jun 05, 2008
Posts: 110
I think that in the book they refer to request parameters, NOT init parameters.
init parameters are constants defined in web.xml.

Example of sending parameters with <jsp:include> or <jsp:forward> :
<jsp:include page="login.jsp">
<jsp aram name="username" value="jsmith" />
</jsp:include>


SCJP 5, SCWCD 5
Anand Bhatt
Ranch Hand

Joined: May 30, 2007
Posts: 189
Hi,
its reallly a good question? Anyone cheack it out what servlet code is generated for these params. I too waiting for solutions to this query.
Amol Lekurwale
Greenhorn

Joined: Jun 12, 2008
Posts: 6
I meant request parameters and not INIT parameters. In the book its clearly mentioned that they are sent as "Request Parameters"
John Pearson
Ranch Hand

Joined: Oct 19, 2007
Posts: 51
In the servlet that is generated from the JSP, the container makes a call to an include() method. One of the parameters is the request path. If you specified a parameter with <jsp:param ... />, that parameter is tacked onto the end of the path.

For instance, if my JSP contains:



the servlet generated by the container (in this case, Tomcat) will have:



Not the most readable code in the world, but it works.

Hope this helps.

Sorry for the multiple edits. Those smilies kept trying to sneak back into my listings.

[ June 16, 2008: Message edited by: John Pearson ]

[ June 16, 2008: Message edited by: John Pearson ]
[ June 16, 2008: Message edited by: John Pearson ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding Request Parameter Passing
 
Similar Threads
RESTFul web service
Servlet Forward Command
Post method - Not able to bookmark the page
Ensure correct sequence of printing of request parameters ?
Which server-side script takes the input from JavaScript in j2ee application