• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Identification form issue

 
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
I am trained to take a course in French on javaEE, everything is not explained, here is my problem:
1 / I set up a simplified access solution to my website, I start the home page index.jsp (in WebContent) which has a link to an identification jsp:
   identification.jsp that is on the ( WebContent / WEB-INF) so far no error!
2 / my page of identification (I do not describe the design) with two textbox: login and password, I developed a javabean with a servlet.
3 / for the authentication I put in the bean (as I have not had the courses yet on the database, I would see its later) the password is: login + "123" (string).
4 / If I can not authenticate I remain on the page indentification.jsp with a word "error autentification", then I start again authenticated
  (the case here is easy, login + "123"), but not Of luck it shows me aNothing happens after the "submit" or error 500
5 / if I enter the correct password (login + "123") I have a link to another page jsp >> intranet.jsp but also I have aNothing happens after the "submit" or error 500.

What should you think or do to reach the intranet.jsp page.

Here are my different components:

1/ identificaton.jsp


here the java bean :


here the servlet



I can not set conditions like "if" in my servlet! I do not understand

So I have a hard time understanding the scope of <action> in "<form> =" post "action =" identification ">" what I can set as parameters in "action"


Regards
Philippe
 
Ranch Hand
Posts: 285
2
jQuery Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Philippe Ponceblanc wrote:hello,


I can not set conditions like "if" in my servlet! I do not understand

So I have a hard time understanding the scope of <action> in "<form> =" post "action =" identification ">" what I can set as parameters in "action"

Regards
Philippe



The action parameter specifies upon which request i.e URL pattern the form values should be posted to servlet.  Here, Identification is the action parameter which means when requesting for URL Identification  the form action post method will trigger. Request parameters can also be identified inside the servlet as you have done in Identification class. May I know what are you trying to do inside the Servlet using if condition ?

Kind Regards
 
Ranch Hand
Posts: 51
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In doPost method of Identification servlet use this code to redirect user to views/intranet.jsp:

// Forward to /WEB-INF/views/intranet.jsp
      // (Users can not access directly into JSP pages placed in WEB-INF)
      RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher("/WEB-INF/views/intranet.jsp");
       
      dispatcher.forward(request, response);
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like there is a syntax error on line 12 of your XML.  It should be:

After the first <p> should be a <.

Just a note here about using code tags:  Thank you for using them!  You can and should change the syntax highlighting for XML by changing the dropbox that has "Java" in it to "XML".  Do this before pressing the Code button.  I did it for you and I noticed the problem.
 
Knute Snortum
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RE: posting XML: You can also change the code tagattribute by hand:

[code=xml]
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
In my login form gives access if the condition "ident = true" (which is in my java bean) has intranet.jsp which contains a jsp page
selection menu, some of these pages will have access to the database Is another pages of scientific calculations.
Thank you for the small ">" missing my jstl.
I tried the code you gave me!



ca marche bien en enlévant le "view" de :

// Forward to /WEB-INF/views/intranet.jsp
      // (Users can not access directly into JSP pages placed in WEB-INF)
      RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher("/WEB-INF/intranet.jsp")



I would like something like that in pseudo java code:


I have another problem that appears is that my session "the scope" is still valid, how to make that the scope
of the identification is valid only once! Otherwise the identification is always true

Kind regards
Philippe
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i forgot my web.xml

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic