| | |
<jsp:forward> problems
![]() |
•
•
Join Date: Jan 2008
Posts: 32
Reputation:
Solved Threads: 0
Hi,
I have a JSP which searches through a database of categories and displays each one with a unique link if clicked. When the link is clicked it sends it to itself and saves it into a variable. <jsp:forward> is then called which should send the variable as a parameter to the next page.
This is working correctly and I can retreive the parameter on the net page.
The funny thing is the next page only returns to the calling page information if I have little code in it, otherwise it is completely blank! Hopefully you can see from the code that the first two lines work correctly ONLY if I ommit the rest (below the comments)
This seems like such a novel problem, and I realise it probably has a simply solution.
Thanks for you help
I have a JSP which searches through a database of categories and displays each one with a unique link if clicked. When the link is clicked it sends it to itself and saves it into a variable. <jsp:forward> is then called which should send the variable as a parameter to the next page.
This is working correctly and I can retreive the parameter on the net page.
The funny thing is the next page only returns to the calling page information if I have little code in it, otherwise it is completely blank! Hopefully you can see from the code that the first two lines work correctly ONLY if I ommit the rest (below the comments)
java Syntax (Toggle Plain Text)
<%@ page import="java.sql.*" %> <%@ page import="java.util.*" %> <%@ include file="connection.jsp" %> <%String value = request.getParameter("category"); %> <%=value%> //The code below here prevents the WHOLE page showing returning nothing to the page that called the <jsp:forward> //whereas without the above two lines work correctly <% ResultSet columns1 = statement.executeQuery("SELECT * FROM Questions"); while(columns1.next()) { id = columns1.getString("ID"); Question = columns1.getString("Question"); Answer = columns1.getString("Answer"); Updated = columns1.getString("Stamp"); Author = columns1.getString("UserID"); %> <a href="custarea.jsp?question=<%=Question %>"><%=Question %></a> <br /> <% if (Question.equals(key)) { %> <table border="1"> <tr> <td> <%= Answer %> <% session.setAttribute("key", key); %> </td> </tr> <tr> <td align="right"> <form name="useful" action="addrating.jsp" method="get"> Was this answer useful? <select name="useful" onChange="send()"> <option>-</option> <option value="Yes">Yes</option> <option value="No">No</option> </select> </form> </td> </tr> </table> <% } } %>
This seems like such a novel problem, and I realise it probably has a simply solution.
Thanks for you help
![]() |
Similar Threads
- JSTL compare string (JSP)
- server transfering prolems for jsp application, plzzz help!!! (JSP)
- Help for learnign JSP (JSP)
- Opinions? javascript/php/etc and programming standards (JavaScript / DHTML / AJAX)
- hover over text tips (JavaScript / DHTML / AJAX)
Other Threads in the Java Forum
- Previous Thread: My First Tutorial in Java [Want your opinion]
- Next Thread: How to make the command window not come up while running an .exe in Java
| Thread Tools | Search this Thread |
-xlint add android api applet application applications array arrays automation bank bi binary blackberry bluetooth chat class client code compile compiler component database development digit eclipse equation error event fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying pearl problem program programming project qt recursion scanner screen scrollbar server set sms sort sorting spamblocker sql sqlserver string superclass swing system text-file thread threads tree variablebinding windows xor





