• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Why will this not work?

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I simply trying to pass variables from a JSP form into a bean and then extract them with another JSP page and I cannot get it to work!!

Here is the code for my Login.JSP:


And here is the code for my success.jsp:


Finally, here is my bean code:


Any help would be very...Helpful!
Bryan
[ August 09, 2005: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So at what point are you storing the values from your login form into the bean? Because I don't see where you have done that.
 
Bryan Scarbrough
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was curious about that as well, so how do I store them?
 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you need to put the first two lines of Login.jsp in success.jsp....
 
Bryan Scarbrough
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did that but Tomcat gives me the following error:

HTTP Status 500 -
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException
org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:359)
org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:306)
org.apache.jasper.runtime.JspRuntimeLibrary.introspect(JspRuntimeLibrary.java:284)
org.apache.jsp.success_jsp._jspService(org.apache.jsp.success_jsp:52)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NullPointerException
org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:320)
org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:306)
org.apache.jasper.runtime.JspRuntimeLibrary.introspect(JspRuntimeLibrary.java:284)
org.apache.jsp.success_jsp._jspService(org.apache.jsp.success_jsp:52)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From your Code the first two lines

<jsp:useBean id="login"...
<jsp:setProperty name="user"...

is not neccessary for your login.jsp page and there is a mistake there anyway. the id="login" should be the same with the name="login" as in:

<jsp:useBean id="login"...
<jsp:setProperty name="login"...

and not the way you used it. Take note.

As i was saying your login.jsp does not need the first two lines.

Now to your success.jsp page:

it should have some code similar to this at the top:

<jsp:useBean id='login' class='com.services.db.SqlConnect' scope='session'>
<jsp:setProperty name='login' property='userName' value='<%=request.getParameter("userName")%>'/>
<jsp:setProperty name='login' property='password' value='<%=request.getParameter("password")%>'/>
<jsp:useBean/>
<html>
...
.
.
.
</html>

if I were writing this I would be submitting to a servlet and not directly to a JSP.. anyways I hope this solves your problem
 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Disregard the servlet comment...
 
Bryan Scarbrough
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SWEET!!! Thanks Ola Daniel, its alive!
 
My first bit of advice is that if you are going to be a mime, you shouldn't talk. Even the tiny ad is nodding:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic