Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes retrieve value from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "retrieve value from JSP" Watch "retrieve value from JSP" New topic
Author

retrieve value from JSP

Ameya Bhagwat
Greenhorn

Joined: Aug 09, 2013
Posts: 5
suppose i m in a.jsp and i have given a href to b.jsp so when i click on that link it takes me to b.jsp now i have to pick a value and want to bring that value to a.jsp
so any 1 who can help??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Pass the value on the URL as a request parameter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ameya Bhagwat
Greenhorn

Joined: Aug 09, 2013
Posts: 5
the problem is i have a.jsp through which i am passing my value to 1.jsp and saving them in database.

nw b.jsp is retrieving value from 2.jsp.



nw if i am at a.jsp nd if i clicked on selct went to b.jsp nd select a value come again to a.jsp and value get inserted in that input box of select how is poosible??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Ameya Bhagwat wrote:the problem is i have a.jsp through which i am passing my value to 1.jsp and saving them in database.

nw b.jsp is retrieving value from 2.jsp.



nw if i am at a.jsp nd if i clicked on selct went to b.jsp nd select a value come again to a.jsp and value get inserted in that input box of select how is poosible??

Sorry but I cannot understand what you are trying to say. Your post is full of abbreviations like nw, nd, selct, that make it impossible to read. Please UseRealWords and try posting again.
Ameya Bhagwat
Greenhorn

Joined: Aug 09, 2013
Posts: 5
i make session objects but still it giving error






org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 34 in the jsp file: /support.jsp
The method print(boolean) in the type JspWriter is not applicable for the arguments (void)
31: <tbody>
32: <tr>
33: <td>
34: <label> <a href="sale_new.jsp" onclick="transfer(<%=session.setAttribute("name",request.getParameter("org_name"))%>)"> <%=rs.getString("org_name")%>" </a></label>
35: </td>
36: <td>
37: <%=rs.getString("industry")%>


Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

Perhaps you would have better luck folioing proper practices and moving all database access code to a Java class rather than inappropriately trying to shove it into the JSP. Putting Java code in a JSP has been obsolete for 12 years for good reasons.

Please read these articles:
  • The Secret Life of JSPs
  • The Front Man

  •  
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: retrieve value from JSP
     
    Similar Threads
    Finding current URI?
    Pass parameters from one jsp page to other jsp page
    send value using response.sendRedirect()
    Problem caused by pressing the 'BACK' button on the broswer
    diff. between jsp:include and include directive