Using tiles and container managed security/form based login

2002-10-28 Thread Alan P Sexton

[I have moved this branch of this thread to struts-users as it no longer
belongs on struts-dev; was: RE: [SURVEY] HREF attribute for FormTag] 

Thanks,

I should be able to use that advice to fix my problem. However I
still don't understand why my approach doesn't work:

I have CMS set up on /*. I put all my jsps under WEB-INF as per various
FAQ advice. Tomcat needs an accessible logon.jsp so that stays outside
(/logon.jsp). However, that just contains a logic:forward to a global
forward to /WEB-INF/jsp/logon.jsp which contains the appropriate
j_security_check form (in plain html). This works fine (although
thinking about it, it is not good as it is a jsp forwarding to a jsp -
even if it is the only one in my setup).

I then tried replacing the /logon.jsp forward to /WEB-INF/jsp/logon.jsp
to a forward to my new logon tile tile.cmsLogon. This does not
work. However I am sure that the setup of this tile is correct (famous
last words). I suspect it is something to do with how tile definitions
are spliced into the forwards' namespace but have not had time to figure
out enough of the Struts sources to be sure.

I hadn't thought of forwarding to a proper action instead which could
forward to a tile.

Many thanks

Alan

Hal Deadman writes:
  
  I have a container managed security login page fragment that is a Tile and
  don't recall having any problem. Is the problem that you are trying to
  specify a tile as the form-login-page? My form is using HTML for the form
  tag and the username and password fields. When I specify the login page, I
  specify struts actions as follows to give me a little more control over what
  I display on the login jsp. The login.do action is then mapped to a Tile
  component that eventually contains a login.jsp. You can use the url
  parameters to determine in your action if you need to display a message to
  the user about their login attempt not working.
  
  login-config
  auth-methodFORM/auth-method
  realm-nameRpowerRealm/realm-name
  form-login-config
  form-login-page/login.do?type=attempt/form-login-page
  form-error-page/login.do?type=failed/form-error-page
  /form-login-config
  /login-config
  
  
Cheers,
   
Alan
  
   Craig
  

Alan


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: Using tiles and container managed security/form based login

2002-10-28 Thread Alan P Sexton

I am using logic:forward rather than jsp:forward. I had not checked it
but had assumed (perhaps naively) that since that is part of struts, it
would be tiles plugin aware. If it is not, then that would certainly
explain my symptoms and your suggestion will fix it.

Many thanks again.

Alan

  
  
   I then tried replacing the /logon.jsp forward to
   /WEB-INF/jsp/logon.jsp
   to a forward to my new logon tile tile.cmsLogon. This does not
   work. However I am sure that the setup of this tile is correct (famous
   last words). I suspect it is something to do with how tile definitions
   are spliced into the forwards' namespace but have not had
   time to figure
   out enough of the Struts sources to be sure.
  
  Are you using jsp:forward to forward from the logon.jsp? If so, that tag
  doesn't know how to handle tiles. You need to send the request through the
  controller servlet, with tiles properly setup. Then the tiles plug-in
  intercepts the forward and checks to see if it's really a tile.
  
  --from struts-config.xml
  action path=/login type=org.eei.rpwr.common.ui.LoginAction
   forward name=success path=nav.login redirect=false /
  /action
  
  --from tiles-definitions.xml
  definition name=nav.login extends=standard
  put name=body   value=nav.login.body /
  /definition
  definition name=nav.login.body path=/tiles/toplevel.jsp
  put name=content   value=/login.jsp /
  /definition
  
  
   I hadn't thought of forwarding to a proper action instead which could
   forward to a tile.
  
   Many thanks
  
   Alan
  
   Hal Deadman writes:

 I have a container managed security login page fragment that is a Tile and
 don't recall having any problem. Is the problem that you are trying to
 specify a tile as the form-login-page? My form is using HTML for the form
 tag and the username and password fields. When I specify the login page, I
 specify struts actions as follows to give me a little more control over what
 I display on the login jsp. The login.do action is then mapped to a Tile
 component that eventually contains a login.jsp. You can use the url
 parameters to determine in your action if you need to display a message to
 the user about their login attempt not working.

 login-config
 auth-methodFORM/auth-method
 realm-nameRpowerRealm/realm-name
 form-login-config
 form-login-page/login.do?type=attempt/form-login-page
 form-error-page/login.do?type=failed/form-error-page
 /form-login-config
 /login-config


   Cheers,
  
   Alan
 
  Craig
 
  
   Alan
  

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org