Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

form based authentication example

 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic