aspose file tools*
The moose likes Servlets and the fly likes loading a jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "loading a jsp page" Watch "loading a jsp page" New topic
Author

loading a jsp page

kevin schmidt
Ranch Hand

Joined: Aug 24, 2001
Posts: 85
I have a jsp page that some of the contents are loaded depending on what is chosen from a drop box. But when you load the page initially, nothing appears because nothing has been selected from the box. I want to set one of the options as a default so when the page is initially loaded, the one certain view always appears first. Right now I have an if else statement:
if((request.getParameter("sort")).equals("Date")) {%>
<%@ include file="display_sort.jsp" %>
<%
out.println("</td></tr>");
out.println("<tr><td>");
}
else if((request.getParameter("sort")).equals("Newspaper") ){ %>
<%@ include file="display_news.jsp" %>
<%
out.println("</td></tr>");
out.println("<tr><td>");
} %>
Now, I want display_news.jsp to be the default when the page is loaded, just not sure how to do that. Thanks for peoples patience!
Kevin
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
Then you may want to consider the include ACTION instead (it's dynamic):
<jsp:include page="your_file_here.jsp" flush="true"/>


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Manjunath Reddy
Ranch Hand

Joined: Jul 26, 2001
Posts: 60
continuing ur logic...use else condition to display the news list for all other cases
else { %>
<%@ include file="display_news.jsp" %>
<%
out.println(" </td></tr>");
out.println(" <tr><td>");
} %>
Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227

or else before checking for selection write Javascript to make default selection.
RGds
Manohar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: loading a jsp page