So remember in the <servlet-class>login</serv
the <servlet-name>login</servl
Main Topics
Browse All Topicshi i have implemented a set of servlet pages....
i have implemented a loginpage.html which redirects to the servlet which processes the login
via checking the usr name and password against a database...
all works fine...
however on further reading i have discovered predefined security measures
i have come up with the following for the web.xml
[code]
<security-constraint>
<web-resource-collection>
<web-resource-name>Test</w
<url-pattern>/LoginForm.ht
<http-method>GET</http-met
<http-method>POST</http-me
</web-resource-collection>
<auth-constraint>
<role-name>manager</role-n
<user-data-constraint>
<transport-guarantee>NONE<
<auth-method>FORM</auth-me
<form-login-config>
<form-login-page>/LoginFor
<form-error-page>/LoginErr
</form-login-config></logi
<servlet>
<description>
</description>
<display-name>loginCheck</
<servlet-name>loginCheck</
<servlet-class>loginCheck<
</servlet>
<servlet>
<description>
</description>
<display-name>login</displ
<servlet-name>login</servl
<servlet-class>login</serv
</servlet>
<servlet-mapping>
<servlet-name>ApageMaker</
<url-pattern>/ApageMaker</
</servlet-mapping>
<servlet-mapping>
<servlet-name>login</servl
<url-pattern>/login</url-p
</servlet-mapping><welcome
<welcome-file>index.html</
<welcome-file>index.htm</w
<welcome-file>index.jsp</w
<welcome-file>default.html
<welcome-file>default.htm<
<welcome-file>default.jsp<
<welcome-file>LoginForm.ht
</welcome-file-list>
</web-app>
[/code]
now the part i dont' get is that my login,html now has the following
[code]
<form action="j_security_check" method = "get">
<h1 align="center"></br> Coffee RTIS Login </h1>
<center>
<table border ="0">
<tr>
<td ><h3>user name</br></h3></td>
<td>
<input type="text" name = "j_username">
</td>
</tr>
<tr>
<td><h3>password</h3></td>
<td>
<input type="password" name = "j_password">
</td>
</tr>
</table>
<input type ="submit" value = "Login!">
[/code]
in the old version the action redirceted to s servlet ie
[code]
<form action="www.servlet.com\se
[/code]
which redirects to the login processing servlet....
in the new version, where or how do you store a list of logins ....
or how do you redirect to a login processing servlet...
thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: javaexpertoPosted on 2009-11-08 at 10:56:14ID: 25771410
Hello Symon, the security thing here is that you don't call directly your Servlet, you do through the <url-pattern> in your web.xml file. In this case you have:
et-name> let-class> et-name> attern>
let-class> part you put the name of your Servlet and in the attern> the way you will call it.
<servlet>
<servlet-name>login</servl
<servlet-class>login</serv
</servlet>
<servlet-mapping>
<servlet-name>login</servl
<url-pattern>/login</url-p
</servlet-mapping>
the url-pattern part means that you will call your Servlet class named login, with the /login pattern, like this:
<form action="login" method = "get">
So remember in the <servlet-class>login</serv
<url-pattern>/login</url-p
Good luck