> Hi,
> I have a simple/silly question..
> I would like a jsp to display different parts of the html page depending
on
> the way it is called...How do I call another jsp page with diferent
> attributes...
>
> like::
>
> <%@    include file="helloworld.jsp?showme="true    %>
>

This is incorrect syntax. The @include just includes your jsp file "inline"
before processing the whole file, much like a header file in "C" (if that
means anything to you!).

> Now the helloworld.jsp shows different parts of the html page based on the
> showme attribute...It does not seem to work..How do I go about doing
> this..??
>

I think what you want to do is to process the request (from your
web-browser) and control the program logic based on a request parameter.
Assuming you had a parameter called "showme" sent from your HTML page, your
JSP script would be:



<%
String strShowMe = request.getParameter("showme");

if (strShowMe.equals("true"))
{
    // ..process code and output HTML
}
else
{
    // do some other stuff
}

%>


Remember, that your HTML form can actually be in the JSP file and submit to
itself, using parameters to control the program flow.

HTH

John Wheeler.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to