Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Identification form issue  RSS feed

 
Philippe Ponceblanc
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • 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
 
Mohammed Sardar.
Ranch Hand
Posts: 126
1
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • 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
 
Mark Spencers
Ranch Hand
Posts: 51
2
  • Mark post as helpful
  • send pies
  • 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);
 
Knute Snortum
Sheriff
Posts: 3842
91
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • 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: 3842
91
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RE: posting XML: You can also change the code tagattribute by hand:

[code=xml]
 
Philippe Ponceblanc
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • 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: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i forgot my web.xml

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!