•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 402,860 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,978 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 681 | Replies: 1
![]() |
•
•
Join Date: Nov 2007
Posts: 22
Reputation:
Rep Power: 1
Solved Threads: 0
I have a Servlet that checks for information and if there is an issue it forwards the message to presentation page (JSP). Now I want to stop using conditions in scriptlets in the JSP. Please advise how I can do it in this situation in my Tomcat 4.1.27 container. I dont have JSTL or EL due to restrictions in my environment.
Servlet that forwards to JSP:
JSP
Please advise.
Servlet that forwards to JSP:
String gotopage = "";
if(mydata == 1)
{
gotopage = /"pager.jsp?mymessage=err";
}
else if(mydata == 34
{
gotopage = /"pager.jsp?mymessage=duper";
}
else
{
gotopage = /"pager.jsp?mymessage=proc";
}
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(gotopage);
dispatcher.forward(request, response);
... java Syntax (Toggle Plain Text)
<% String mymessage = request.getParameter("mymessage") if(mymessage.equals("err")) { out.println("Error on the page"); } else if(mymessage.equals("dup")) { out.println("Duplicate issue."); } else if(mymessage.equals("proc")) { out.println("Process message issue"); } %>
Please advise.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- jsp and mysql (JSP)
- how to use jsp and tomcat (JSP)
- JSP codes seems not executed correctly (JSP)
- Can't run JSP in Browser (JSP)
- Word.doc upload using JSP (Java)
- Can't run JSP in Browser (Web Browsers)
- JSP and Oracle (JSP)
Other Threads in the JSP Forum
- Previous Thread: jsp and beans
- Next Thread: Servlet /Jsp


Linear Mode