*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jsp:param with jsp:include Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jsp:param with jsp:include" Watch "jsp:param with jsp:include" New topic
Author

jsp:param with jsp:include

vinal sen
Ranch Hand

Joined: Dec 13, 2007
Posts: 37
Hai all, Could someone please help me with the code(from HFSJ) below:


JSP that does the include (contact.jsp)



The included header that uses the new param ("header.jsp")



<em> <strong> ${param.subtitle} </strong> </em>



The above example as given in the book,tries to set the subtitle based on the settings in the header.jsp.But it gets the value from "contact.jsp"

Are we using jsp:param just to set how they appear in the "contact.jsp".Is my understanding correct?

Please explain.

Thank you,Vinal



Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

You use jsp:param with jsp:include and jsp:forward to add extra parameters to the servlet request. Those extra parameters are only available in the included / forwarded servlet / JSP page; after the jsp:include / jsp:forward end tag the parameters are no longer there.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
vinal sen
Ranch Hand

Joined: Dec 13, 2007
Posts: 37
thanks Rob Prime!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsp:param with jsp:include
 
Similar Threads
HFSJ P408 jsp Include tag example
jspf not working with <jsp:include> and <jsp:param>
Customizing the included content with <jsp:param>
jsp:include question
HFS p408 problem passing parameter