•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 422,398 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 4,775 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 Java advertiser: Lunarpages Java Web Hosting
Views: 807 | Replies: 0
![]() |
•
•
Join Date: Jan 2008
Posts: 27
Reputation:
Rep Power: 1
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
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
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


Linear Mode