permaculture playing cards*
The moose likes Servlets and the fly likes form based authentication example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "form based authentication example" Watch "form based authentication example" New topic
Author

form based authentication example

cyril vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
Hi,
I'm under Tomcat/4.1.18-LE-jdk14 and just have tested form based example provided with the distribution.
When I access http://localhost:8080/examples/jsp/security/protected/index.jsp
i'm well redirected to login.jsp as mentionned in web.xml
<form-login-config>
<form-login-page>/jsp/security/protected/login.jsp</form-login-page>
<form-error-page>/jsp/security/protected/error.jsp</form-error-page>
</form-login-config>

but unfortunately, I've got the following error message:
Generated servlet error:
[javac] Compiling 1 source file
C:\java\plateforme\tomcat\work\Standalone\localhost\examples\jsp\security\protected\login_jsp.java:1: expected
package org.apache.jsp.jsp.security.protected;
^
1 error
I've changed nothing to example's directory, so is it an known error?
How may i fix this?
Thanks in advance for your response,
Regards,
Cyril.


SCJP 1.4, SCWCD, SCBCD, IBM XML, IBM Websphere 285, IBM Websphere 287
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Where did u place your login.jsp and error.jsp? I mean in which folder of the web application... Their locations are very important... And could you mention the web.xml that you use in the web application?
I hope I can help you, if I got more info from you...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
cyril vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
The location of the files error.jsp and login.jsp are
<tomcat-home>\webapps\examples\jsp\security\protected (shipped with distribution)
and the code snippet of web.xml is the following:

Thanks,
Cyril.
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
I think the problem is with the classpath, coz all of the configurations are original as you downloaded and I have checked the contents already...
Is your classpath configured correctly? Verify it in command prompt by using
echo %JAVA_HOME%
It should show your installed java folder with the whole path.
and echo %CATALINA_HOME%
Verify that it shows the real tomcat installation folder
and set classpath to the servlet library too...
which is in yourTomcatFolder\common\lib\servlet.jar (or) similar...
Can u reply to me whether it works or not... It's my pleasure to solve such kind of problem... It improves my technical skill also...
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

Can u reply to me whether it works or not... It's my pleasure to solve such kind of problem... It improves my technical skill also...

You are really very helpful.


Groovy
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Pradeep Bhat:

You are really very helpful.

Hello Pradeep,
It's nice to see you here... I think you are in IDE forum... How's your study on the beta of new SCWCD... I've just filtered the Specs with the objectives, but not yet started to study... But I will next week...
All the best for the exam to you as well...
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

I think you are in IDE forum...

nO. I am no where.

I've just filtered the Specs with the objectives, but not yet started to study

I would be great if you send me the filtered chapters. Thanks Sir!
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Originally posted by Pradeep Bhat:

I would be great if you send me the filtered chapters. Thanks Sir!

Well, I do want to send you one. But what I did on the specs is that I printed out the Specs and marked on the printed papers... I don't know how I can send them to you... But I can tell you what I marked which chapters are involved in the objectives...
I'm afraid that this is not the right forum to talk about it... Let's move to the SCWCD forum...
P.S., I started one thread on SCWCD forum of JDiscuss.com already, in which it will be more specific on the objectives. If there is a chance, I hope I will see you there... But I will surely share my knowledge in SCWCD forum of JavaRanch also...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: form based authentication example
 
Similar Threads
Dobut in Realm Authentication
login-config question
How does the "j_security_check" work?
How do I setup form-based authentication?
Tomcat Security