Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

loading a jsp page

 
kevin schmidt
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you may want to consider the include ACTION instead (it's dynamic):
<jsp:include page="your_file_here.jsp" flush="true"/>
 
Manjunath Reddy
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

or else before checking for selection write Javascript to make default selection.
RGds
Manohar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic