You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Boris Folgmann <mi...@folgmann.com> on 2002/12/18 11:20:49 UTC

tomcat's container based authentication and struts

Hi!

I want to add tomcat's container based authentication to a struts application.

Tomcat already displays my login.jsp, but the problem is to get
action="j_security_check" in the form generated by struts' <html:form>

I tried <html:form action="j_security_check" ...>, but this gets translated
to action="/j_security_check.do" in the generated HTML file. How can I
prevent this, or is there an other way to integrate it in struts?

cu,
	boris




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: tomcat's container based authentication and struts

Posted by Patrice <pp...@nerim.net>.
I think that if you use the <html:form> tag, Struts will always interpret it
as an action.
If it is just for the focus attribute, you can implement your own javascript
function to place the focus on the element you want:

<form name="logonForm" action="j_security_check">
Username: <input type="text" name="j_username"><br>
Password: <input type="password" name='j_password"><br>
<input type="submit">
</form>
<script language="JavaScript" type="text/javascript">
  <!--
    document.forms["logonForm"].elements["j_username"].focus();
  // -->
</script>

Hope it helps
Patrice

----- Original Message -----
From: "Boris Folgmann" <mi...@folgmann.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, December 18, 2002 11:41 AM
Subject: Re: tomcat's container based authentication and struts


> Max Cooper wrote:
> > Just write out a regular HTML form:
> >
> > <form action="j_security_check">
> > Username: <input type="text" name="j_username"><br>
> > Password: <input type="password" name='j_password"><br>
> > <input type="submit">
> > </form>
> >
> > -Max
>
> This works, but I wanted to use e.g. the focus attribute of struts'
> <html:form>. Any idea? Is it a bug in struts that my action is changed
from
> j_security_check to /j_security_check.do?
>
> cu,
> boris
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: tomcat's container based authentication and struts

Posted by Boris Folgmann <mi...@folgmann.com>.
Max Cooper wrote:
> Try <html:form action="/j_security_check">. Perhaps with the slash in front
> of j_security_check, Struts won't interpret it as an action.

No, it doesn't help. Same problem.

cu,
	boris


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: tomcat's container based authentication and struts

Posted by Max Cooper <ma...@maxcooper.com>.
Try <html:form action="/j_security_check">. Perhaps with the slash in front
of j_security_check, Struts won't interpret it as an action.

-Max

----- Original Message -----
From: "Boris Folgmann" <mi...@folgmann.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, December 18, 2002 2:41 AM
Subject: Re: tomcat's container based authentication and struts


> Max Cooper wrote:
> > Just write out a regular HTML form:
> >
> > <form action="j_security_check">
> > Username: <input type="text" name="j_username"><br>
> > Password: <input type="password" name='j_password"><br>
> > <input type="submit">
> > </form>
> >
> > -Max
>
> This works, but I wanted to use e.g. the focus attribute of struts'
> <html:form>. Any idea? Is it a bug in struts that my action is changed
from
> j_security_check to /j_security_check.do?
>
> cu,
> boris
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: tomcat's container based authentication and struts

Posted by Boris Folgmann <mi...@folgmann.com>.
Max Cooper wrote:
> Just write out a regular HTML form:
> 
> <form action="j_security_check">
> Username: <input type="text" name="j_username"><br>
> Password: <input type="password" name='j_password"><br>
> <input type="submit">
> </form>
> 
> -Max

This works, but I wanted to use e.g. the focus attribute of struts'
<html:form>. Any idea? Is it a bug in struts that my action is changed from
j_security_check to /j_security_check.do?

cu,
	boris


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: tomcat's container based authentication and struts

Posted by Max Cooper <ma...@maxcooper.com>.
Just write out a regular HTML form:

<form action="j_security_check">
Username: <input type="text" name="j_username"><br>
Password: <input type="password" name='j_password"><br>
<input type="submit">
</form>

-Max

----- Original Message -----
From: "Boris Folgmann" <mi...@folgmann.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, December 18, 2002 2:20 AM
Subject: tomcat's container based authentication and struts


> Hi!
>
> I want to add tomcat's container based authentication to a struts
application.
>
> Tomcat already displays my login.jsp, but the problem is to get
> action="j_security_check" in the form generated by struts' <html:form>
>
> I tried <html:form action="j_security_check" ...>, but this gets
translated
> to action="/j_security_check.do" in the generated HTML file. How can I
> prevent this, or is there an other way to integrate it in struts?
>
> cu,
> boris
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>