do both req-scope and sess-scope fbeans get stored in the session?

2002-05-26 Thread jfc100

Hi,

I am fairly new to struts and have been reading Ted Husted's chp2 in 
'Prof JSP Site Design' where  it says:

Page 44 The Action Form class :
' The framework assumes that you have created an ActionForm bean for 
each input form required in your application. For every bean defined in 
the struts-config.xml file, the framework does the following before 
calling the perform() method of the Action class:

It checks in the user's session for an instance of a bean of the 
appropriate class, under the appropriate key. If there is no such bean 
available under the session, a new one is automatically created and 
added to the user's session.

...'

My question: Do both request scoped and session scoped form beans get 
stored in the session? If so what is the significance of the scope 
attribute in the action mapping?

Thanks
Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




No getter method available for property ... trying to use a form + formbean

2002-05-19 Thread jfc100

Hi,

I get this msg when trying to reference one of my pages 
('captureProfile.jsp'):

'No getter method available for property profile for bean under name 
org.apache.struts.taglib.html.BEAN'

I have defined the form bean in struts-config:
form-bean  name=userProfileForm
type=com.mycom.forms.UserProfileForm/

and UserProfileForm.java:

package com.mycom.forms;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

public final class UserProfileForm extends ActionForm  {

private String profile = Grocer;
   
public void setProfile(String profile){
this.profile = profile;
}

public String getProfile(){
return this.profile;
}
   
}



and the action mapping:

!-- capture profile --
actionpath=/user/registration/capture/profile
type=com.mycom.actions.RegistrationAction
name=userProfileForm
scope=request
parameter=capture.profile
forward name=capture.profile 
path=user.registration.capture.profile/  //tiles definition
/action


RegistrationAction only returns the 'capture.profile' ActionForward 
instance.

and catureProfile.jsp:
form action=/user/registration/capture/details method=POST 
select name=profile
option selectedGrocer/option
optionButcher/option
optionUndertaker/option
optionAgent/option
/select

input type=submit name=submit value=Submit /
/form

Could someone enlighten me as to why I get the msg?

Thanks
Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




I need help building tiles from src - please

2002-05-13 Thread jfc100

Hi,

I've been trying to build tiles and am struggling a bit.

I downloaded and ran a build of 'jakarta-struts-1.1-b1-src' only to find 
that it doesn't automatically build tiles. When I finish building 
struts, I can see a contrib directory which contains a tiles 
subdirectory with the tiles source in it.

When I read the build.xml notes, it says make sure this file is in the 
root of the struts-src directory.

This is going to override the existing struts build.xml - which is 
surely not what we want.

What is the best way to arrange things?

Thanks
Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: I need help building tiles from src - please

2002-05-13 Thread jfc100

James Mitchell wrote:

Did you try building the webapps?

JM 

-Original Message-
From: jfc100 [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 11:12 AM
To: Struts-User
Subject: I need help building tiles from src - please


Hi,

I've been trying to build tiles and am struggling a bit.

I downloaded and ran a build of 'jakarta-struts-1.1-b1-src' only to find 
that it doesn't automatically build tiles. When I finish building 
struts, I can see a contrib directory which contains a tiles 
subdirectory with the tiles source in it.

When I read the build.xml notes, it says make sure this file is in the 
root of the struts-src directory.

This is going to override the existing struts build.xml - which is 
surely not what we want.

What is the best way to arrange things?

Thanks
Joe


--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


Well, no I didn't. I simply ran 'ant' in the jakart-struts-src-dir.

I noticed something in the struts build.xml file:

snip ...
This script will delegate some of it's tasks to the other build*.xml
scripts (build-webapps.xml, build-tests.xml, ...)
 ... snip

I sounds like this path is not so well trodden i.e. building tiles from 
src.

The reason I'm trying to build Tiles myself from the src is due to an 
anomaly somewhere between jboss and tomcat when it comes to  determining 
a user's login status. (see 
http://main.jboss.org/forums/thread.jsp?forum=49thread=13002 )

I'm trying to create something like this in the Tiles 
template-definition selection code:

public boolean myPsuedoCheckRoleWrapper(HttpServletRequest request, 
String tilesDefnRoleAttribute){

if(tilesDefnRoleAttribute.equalsIgnoreCase(anonymous){
// return true if the user is not logged-in.
// i.e. Jaas login doesn't update the request with 
authentication info - like tomcat does as part of form-based auth -
// so do my own checking - whatever it takes.
// Doing a login is desireable otherwise tiles needs two forward 
tiles-definitions in struts.config 1=anonymous 2=custom(role-based) 
//   - and tiles-defn-conf.xml needs a lot more setup -  not 
very elegent!
return true;
}

boolean tilesResult = request.isUserInRole(role)?true:false;
return tilesResult;
}

Any suggestions and advice are most welcome!
Cheers
Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Overview of session management please

2002-05-07 Thread jfc100

Hi,

Can someone please give a brief overview of session management in struts 
and tomcat.

Just from a developers standpoint, what does tomcat do for you, what 
does struts do ontop of that (if anything) and what is required of the 
developer in order to manage sessions within the webapp?

I can see that there is some form of session management going on without 
me having to do anything explicitly in my servlet.

Thanks
Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




'j_security_check' and unsecured resource access

2002-05-06 Thread jfc100

Hi,

Has anyone encountered the following situation using form-based auth in catalina?

1. login successfully using 'j_security_check';
2. the next request happens to be to an unsecured url (e.g. /do/frontpage (with no 
restrictions in web.xml) -- DispatchServlet -- user.frontpage (tiles)) ;
3. the request methods 'getUserPrincipal()', 'isUserInRole()' and 'getRemoteUser()' 
tell me the user is not logged in (in DispatchServlet)!

  (I'm using jboss244+tomcat401, struts1.0, tiles)

I heard this might be an issue with jboss.

Can anyone confirm?

Joe



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: ideal method to set the sessionid in struts?

2002-05-01 Thread jfc100

Galbreath, Mark wrote:

Right, I just wanted to give him the options, since it appears he doesn't
understand session persistence mechanisms.

Mark

-Original Message-
From: Vikram Goyal01 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 8:06 AM
To: Struts Users Mailing List
Subject: RE: ideal method to set the sessionid in struts?


Exactly my point... :)

V

-Original Message-
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 5:29 PM
To: 'Struts Users Mailing List'
Subject: RE: ideal method to set the sessionid in struts?


Oops, sorry...finger slipped off the ' key and hit return.

No, it won't if the method parameter is getSession( false);  
With getSession() or getSession( true), an existing session
will be returned IF IT EXISTS, else a new session for the
request will be created.

Mark

-Original Message-
From: Galbreath, Mark 
Sent: Wednesday, May 01, 2002 7:55 AM
To: 'Struts Users Mailing List'
Subject: RE: ideal method to set the sessionid in struts?


No it won't.

-Original Message-
From: Vikram Goyal01 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 7:52 AM
To: Struts Users Mailing List
Subject: RE: ideal method to set the sessionid in struts?


It will create and return a session if none exists. If session exists it
will return that.

V

-Original Message-
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 5:20 PM
To: 'Struts Users Mailing List'
Subject: RE: ideal method to set the sessionid in struts?


No.

-Original Message-
From: jfc100 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 6:43 AM

I think I can assume that calling 'request.getSession()' 
explicitly will always return an existing session.

Is that correct?

Joe

--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


ok, well somewhere a session is being created without me having to 
explicitly create one - perhaps in the struts controller.

This is why I say that my call to getSession() in MyAction will only 
return an existing session.

Joe



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




ideal method to set the sessionid in struts?

2002-04-30 Thread jfc100

Hi,

I have noticed that without me having to store the sessionid in a cookie 
in the response, my browser contains a JSESSION cookie. I also have 
mozilla set to 'ask before setting any cookies' and I wasn't asked.

What is happening here?

Thanks
Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: ideal method to set the sessionid in struts?

2002-04-30 Thread jfc100

Tero P Paananen wrote:

What is happening here?


Your app server sets the session id cookie.

   -TPP

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


So does this mean that I never have to set cookies?

(I'm using jboss.)



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




some more info about this - I'm still looking for help!

2002-04-30 Thread jfc100

jfc100 wrote:

  Hi,

 tc323jboss241a,tiles+struts

 Can anyone explain this to me. In a struts action servlet, I 
 invalidate a form-based-authenticated user's session object 
 (successfully) and then immediately call getUserPrincipal(), in the 
 same servlet, which returns the users name. It seems the user is only 
 truely logged out once a response has been returned to the client 
 because the very next request is treated as an unauthenticated user.

 In this case I would like the user to be seen by the presentation 
 layer as being already logged out (i.e. as the goodbye page is 
 constructed).

 Joe

 (How do I know it was successfully invalidated? Because I cannot 
 access its attributes when trying to see if it still contained the 
 username/password. I get a msg saying the session was invalidated.)




 -- 
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]


This is the security environment:

I have, as yet, not set up ejb security as I would like to leave that 
out altogether if possible but still have declarative security available 
to use in the ejb tier if neccessary.

So at the moment I am simply using form-based authentication which 
(somehow?) is routed through to the DatabaseServerLoginModule (defined 
in auth.conf) which interogates the appropriate db tables(the default 
ones).

I can login and logout of my app although when I logout, it seems as 
though only after the current request has been handled completely that I 
am logged out. I want the tiles processor to recognize that the current 
user is now no longer logged in - i.e. on the way out, so that the now 
logged out user sees the appropriate response.

 I have a debug statement in the action servlet which prints loggedIn == 
true after I have invalidated the session.

Any help much appreciated!

Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




getUserPrincipal() returns not null immediately after session invalidated.

2002-04-29 Thread jfc100

  Hi,

tc323jboss241a,tiles+struts

Can anyone explain this to me. In a struts action servlet, I invalidate 
a form-based-authenticated user's session object (successfully) and then 
immediately call getUserPrincipal(), in the same servlet, which returns 
the users name. It seems the user is only truely logged out once a 
response has been returned to the client because the very next request 
is treated as an unauthenticated user.

In this case I would like the user to be seen by the presentation layer 
as being already logged out (i.e. as the goodbye page is constructed).

Joe

(How do I know it was successfully invalidated? Because I cannot access 
its attributes when trying to see if it still contained the 
username/password. I get a msg saying the session was invalidated.)




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




How to do 'isUserInRole(unauthenticated)'?

2002-04-24 Thread jfc100

Hi,

Is it possible to determine by calling isUserInRole('unauthenticated'), 
where 'unauthenticated' is an identifier of the anonymous (i.e. the 
not-logged-in) user?

Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: How to do 'isUserInRole(unauthenticated)'?

2002-04-24 Thread jfc100

Struts Newsgroup (@Basebeans.com) wrote:

Subject: Re: How to do 'isUserInRole(unauthenticated)'?
From: Torgeir Veimo [EMAIL PROTECTED]
 ===
jfc100 wrote:

Is it possible to determine by calling isUserInRole('unauthenticated'), 
where 'unauthenticated' is an identifier of the anonymous (i.e. the 
not-logged-in) user?


A unauthenticated user will make the getUserPrincipal() method return a 
null for principal.

ok, but what if I want to select a tiles definition based on the 
unauthenticated user like:


definition name=user.login.welcome 
page=user/login/anonymous/welcome.jsp role=anonymous /

Is there a way to associate the 'nobody' (as specified in the 
'unauthenticatedIdentity' att of the login module) or the null user with 
a role or group?

Thanks
Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




anyone using declarative security? - even a pointer to a resource will do.

2002-04-23 Thread jfc100

Hi again,

I dont mean to sound as though I deserve anyone's attention but I can't 
find any resource on this. I've searched all the forums I know of and 
the net but still can't find any meaningful info on the subject. I've 
also looked at the servlet and jsp specs which don't go into much 
detail. The J2EE developers guide seems to be heavily slanted to 
developing with specific tools.

If someone can offer any suggestion as to how I use the declarative 
security principle, roles and rolegroups to identify users and their 
groups (as outlined below) I would be most grateful.

Cheers
Joe ;-)


jfc100 wrote:

 Hi,

 I would like to implement a user base (using J2EE declarative 
 security) with the following relationship hierarchy :

 Users:
 user = 100, usergroup = 11;

 UserGroups:
 usergroup = 10, groupname=agent, parentgroup = 5;
 usergroup = 11, groupname=privatesupplier, parentgroup = 5;
 usergroup = 5, groupname=supplier, parentgroup = 1;
 usergroup = 1, groupname=user, parentgroup=0;

 This is so that if I say userInRole(supplier) I know I'm dealing with 
 all users in this group as well as all users in all child groups. Or 
 in other words I need to know whether a user is a descendent of a 
 particular ancestor.

 How could I implement this using principals, roles and rolegroups? I 
 mean how do the three relate?

 Thanks
 Joe



 -- 
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]






--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Attribute rewrite is not declared for element forward.

2002-04-22 Thread jfc100

Hi,

Using struts1.0 with tiles, I'm getting the following error msg when 
starting my server:


[snip]
Pop org.apache.struts.action.ActionForward
[Default] Parse Error at line 49 column -1: Attribute rewrite is not 
declared for element forward.
[Default] org.xml.sax.SAXParseException: Attribute rewrite is not 
declared for element forward.
[Default]   at 
org.apache.crimson.parser.Parser2.error(Parser2.java:3013)[
[snip]


I have checked the dtds which are embedded in the struts.jar file for 
the word 'rewrite' and there is no reference to it at all in either 1.0 
or 1.1! The dtd reference in my struts-config.xml file is as follows:

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.1//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;

I have searched this one and the 1_0 version (online) and still no 
reference to rewrite.

Why am I getting this message?

Any help is much appreciated.

Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Attribute rewrite is not declared for element forward.

2002-04-22 Thread jfc100

Cedric Dumoulin wrote:

  This error means that you have used an attribute named 'rewrite' in a forward
... tag in your xml file. Check line 49 ;-)

Cedric

jfc100 wrote:

Hi,

Using struts1.0 with tiles, I'm getting the following error msg when
starting my server:

[snip]
Pop org.apache.struts.action.ActionForward
[Default] Parse Error at line 49 column -1: Attribute rewrite is not
declared for element forward.
[Default] org.xml.sax.SAXParseException: Attribute rewrite is not
declared for element forward.
[Default]   at
org.apache.crimson.parser.Parser2.error(Parser2.java:3013)[
[snip]

I have checked the dtds which are embedded in the struts.jar file for
the word 'rewrite' and there is no reference to it at all in either 1.0
or 1.1! The dtd reference in my struts-config.xml file is as follows:

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.1//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;

I have searched this one and the 1_0 version (online) and still no
reference to rewrite.

Why am I getting this message?

Any help is much appreciated.

Joe

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


Hi Cedric!

I've checked every xml file in my depoyed directory/ war file and there 
is no 'rewrite'. Is the error message not inferring that I should be 
using the rewrite attribute?

Cheers
Joe



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Attribute rewrite is not declared for element forward.

2002-04-22 Thread jfc100

jfc100 wrote:

 Cedric Dumoulin wrote:

  This error means that you have used an attribute named 'rewrite' in 
 a forward
 ... tag in your xml file. Check line 49 ;-)

Cedric

 jfc100 wrote:

 Hi,

 Using struts1.0 with tiles, I'm getting the following error msg when
 starting my server:

 [snip]
 Pop org.apache.struts.action.ActionForward
 [Default] Parse Error at line 49 column -1: Attribute rewrite is not
 declared for element forward.
 [Default] org.xml.sax.SAXParseException: Attribute rewrite is not
 declared for element forward.
 [Default]   at
 org.apache.crimson.parser.Parser2.error(Parser2.java:3013)[
 [snip]

 I have checked the dtds which are embedded in the struts.jar file for
 the word 'rewrite' and there is no reference to it at all in either 1.0
 or 1.1! The dtd reference in my struts-config.xml file is as follows:

 !DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 
 1.1//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;

 I have searched this one and the 1_0 version (online) and still no
 reference to rewrite.

 Why am I getting this message?

 Any help is much appreciated.

 Joe

 -- 
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]



 -- 
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]


 Hi Cedric!

 I've checked every xml file in my depoyed directory/ war file and 
 there is no 'rewrite'. Is the error message not inferring that I 
 should be using the rewrite attribute?

 Cheers
 Joe



 -- 
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]


Aha!

I found the culprit! struts-logon.war has a rewrite in a forward 
definition. So you were right about the rewrite being in an xml file. 
Just 'which xml file?' was the real question.

Thanks for the help!
Joe



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Principals, roles and rolegroups - can anyone give a good short summary?

2002-04-22 Thread jfc100

Hi,

I would like to implement a user base (using J2EE declarative security) 
with the following relationship hierarchy :

Users:
user = 100, usergroup = 11;

UserGroups:
usergroup = 10, groupname=agent, parentgroup = 5;
usergroup = 11, groupname=privatesupplier, parentgroup = 5;
usergroup = 5, groupname=supplier, parentgroup = 1;
usergroup = 1, groupname=user, parentgroup=0;

This is so that if I say userInRole(supplier) I know I'm dealing with 
all users in this group as well as all users in all child groups. Or in 
other words I need to know whether a user is a descendent of a 
particular ancestor.

How could I implement this using principals, roles and rolegroups? I 
mean how do the three relate?

Thanks
Joe



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Using Global Forwards for all entry points to application?

2002-04-21 Thread jfc100

Hi,

Can somebody please explain this suggestion (from the struts catalog) to 
me as I think I must be missing something. Here is the excerpt:


 Use Global Forwards for all entry points to application

 All links in the application should be to ActionMappings. Rather than 
 embed the path to an ActionMapping in a JSP, a link should refer to a 
 Global Forward instead. The Global Forward can include parameters as 
 needed, and should use a logical name that follows the command 
 structure. Compound or path-like names can be used as preferred.

  forward name=itemSearch  path=/do/item/Search/
  forward name=itemFindDonor path=/do/item/Search?column=donor/
  forward name=itemFindScript path=/do/item/Search?column=script/

  forward name=item/Search  path=/do/item/Search/
  forward name=item/Find/Donor path=/do/item/Search?column=donor/
  forward name=item/Find/Script 
 path=/do/item/Search?column=script/

  forward name=item.Search  path=/do/item/Search/
  forward name=item.Find.Donor path=/do/item/Search?column=donor/
  forward name=item.Find.Script 
 path=/do/item/Search?column=script/

 This also allows the parameters to be changed without modifying the 
 JSPs or Actions that use the Global Forward.

 /Very early releases of Struts required subclassing the
 ActionMappings if you wanted to use names other than success and
 failure. The mappings have long since been upgraded so that any
 arbitrary name can be used./

 

If my web.xml is configured to route all /do/* requests to the 
ActionServlet, why should a link refer to a Global forward instead of to 
a for e.g. '/do/registration/capture'? I always thought that the 
forwards were used to select a jsp page or template.

Am I missing something here?

Any thoughts, ideas or enlightenment much appreciated!
Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




To use form-based authentication or not to.

2002-04-19 Thread jfc100

  Hi,

What are the factors involved in selecting form-based authentication 
over, say, custom authentication which can be simple to implement based 
on a db of registered users who have or don't have an indicator stored 
in their session(representing a login)?

An example of custom authentication would be the petstore 1.1.2. which 
incidentally replaces their jps version 1's form-based authentication 
with custom authentication. The jps docs are not well maintained IMO and 
they don't give any reasons for their changes.

Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




StrutsTiles Design: Model2 and authorization

2002-04-12 Thread jfc100

Hi,

I am attempting to put together a standard run-of-the-mill 
membership-based webapp utilizing Struts/Tiles on tomcat+jboss adhering 
to accepted Model2 design pattern. The site will be acting as a kind of 
portal for both supplier and customer so I am looking to incorporate 
seperating views based on who the user is. (e.g. only a user in the 
supplier group will see links to advert placement functionality).

I have just recently been looking at Tiles and how it can be used to 
assemble the view of the webapp. All this stuff seems to have a lot of 
potential to gel together but I'm not quite there yet so I will try to 
ask as concise a question as possible without confusing myself!.

What is a good way to approach seperating jsp pages from each other 
based on a) functionality and b) user authorization, within struts and 
tiles?

In other words: Is it a good idea to maintain an inheritance tree of 
tiles definitions (xml) and then to maintain a seperate directory tree 
of implementation jsp pages for each user group? This would mean 
possibly that at some point a jsp file would contain tags like 
logic:present role=Customer to distinguish between users and forward 
or include content which had been duplicated (into seperate 
'user-template' directories) but tailored for each user group which was 
allowed access to that piece of functionality?

I can see that in terms of functionality that the action mapping's 
forward must know which page to select based on functionality. Should 
the Action servlet select a particular forward based on who the user is 
too or should this be left to the utilization of tags in the jsp 
pages/templates?

One of the resources (the struts design tips catalog) mentions that the 
view should be pretty but stupid. What bearing does this have on the 
above questions?

Thanks
Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Good process for develop/build/deploy/test cycle

2002-04-12 Thread jfc100

Wellie W. Chao wrote:

I'm not exactly sure what you mean by incorporate user authorization into
selected a 'forward' view mapping. If you want container-managed security,
just add it to your web.xml like so:

  security-constraint
web-resource-collection
  web-resource-nameAdmin/web-resource-name
  descriptionAdmin functions/description
  url-pattern/admin/*/url-pattern
  http-methodGET/http-method
  http-methodPOST/http-method
/web-resource-collection
auth-constraint
  role-nameadmin/role-name
/auth-constraint
user-data-constraint
  transport-guaranteeNONE/transport-guarantee
/user-data-constraint
  /security-constraint

  login-config
auth-methodFORM/auth-method
form-login-config
  form-login-page/security/login.do/form-login-page
  form-error-page/security/loginError.do/form-error-page
/form-login-config
  /login-config

My login.do maps using tiles to login.jsp, which looks like this:

%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
pPlease login./p
form action=html:rewrite page=/j_security_check/ method=POST
  pUsername: input type=text name=j_username size=20/p
  pPassword: input type=password name=j_password size=20/p
  pinput type=submit value=Login/ html:link
forward=security.forgotPasswordForgot your password?/html:link/p
  pDon't have a login? html:link
forward=security.registerRegister/html:link to get access to great jobs
or to post your jobs and get great candidates!/p
/form

Whenever the user tries to access a protected directory (specified in
web.xml), they are directed to the login page. Once they successfully log in
with a valid username and password, they go to the page they were trying to
access.

Hope this helps.

-Original Message-
Posted: Apr 10, 2002 8:01 AM

Hi,

I'm using JBoss241+tomcat323 (and have started looking at struts). From a
JBoss deployment standpoint, the hot deploy should work which will negate
the need to restart the server after a code change during the development
cycle. I'm not yet using JBoss3 so I don't know whether the bug(which it
sounds like it is) has been fixed yet.

By the way, if you are using struts+jboss, could you tell me how to
incorporate user authorization into selecting a 'forward' view
mapping(within an action mapping in struts-config)?

if this is off-topic, can you email me at [EMAIL PROTECTED], or post to
[EMAIL PROTECTED] - thanks!

Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


Hi Wellie,

Please see my post on this list entitled 'StrutsTiles Design: Model2 and 
authorization' - sorry about all the directing and redirecting I dished 
out!

Joe

helps to get the reply-to-address right:-)



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




/do/* instead of *.do in web.xml

2002-04-12 Thread jfc100

Hi,

Has anyone managed to use /do/* instead of *.do successfully in web.xml? 
The struts catalog mentions a few benefits but I've not managed to get 
it to work yet. (*.do works but not /do/*).

Any ideas?

Thanks
Joe


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: /do/* instead of *.do in web.xml

2002-04-12 Thread jfc100

Rob Jellinghaus wrote:

 Here's my semi-recent post about this very issue.

 What is your problem, exactly?

 Cheers,
 Rob


 Date: Tue, 09 Apr 2002 19:45:31 -0800
 To: Struts Users Mailing List [EMAIL PROTECTED],
  [EMAIL PROTECTED]
 From: Rob Jellinghaus [EMAIL PROTECTED]
 Subject: Never mind (was Re: Problems changing example to use /action 
 URL mapping)
 In-Reply-To: [EMAIL PROTECTED]
 Mime-Version: 1.0
 Content-Type: text/plain; charset=us-ascii; format=flowed

 Well, I got my IDEA (http://www.intellij.com/idea) configuration set 
 up to run Struts under Tomcat in the debugger (thank goodness for 
 built-in remote debugging support!).  Compiled the Struts source, 
 compiled the struts-example source, started setting breakpoints and 
 looking at things.

 It turns out, as you all know, that the action names are post-mapping, 
 so an /action/* servlet mapping converts an URI of 
 /struts-example/action/logon to an action name of /logon.  It also, of 
 course, turns out that all HREF entries and other paths *do* need the 
 /action context.  (So your action mapping entries should have /logon, 
 but your HREFs and links should be /action/logon.)

 Once I understood that, I was able to get rid of *.do.

 Next time I won't be so quick to ask questions :-)
 GOD I LOVE OPEN SOURCE!
 Cheers!
 Rob



 At 02:40 PM 4/12/2002 -0400, Galbreath, Mark wrote:

 yep.

 -Original Message-
 From: jfc100 [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 12, 2002 2:28 PM
 To: Struts-User
 Subject: /do/* instead of *.do in web.xml


 Hi,

 Has anyone managed to use /do/* instead of *.do successfully in web.xml?
 The struts catalog mentions a few benefits but I've not managed to get
 it to work yet. (*.do works but not /do/*).

 Any ideas?

 Thanks
 Joe


 -- 
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

 -- 
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]




 -- 
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]


Got it working - thanks!

I was accessing a webapp behind a directory in tc/webapps i.e. 
tc/webapps/tutorial and I was putting the 'do' at the beginning of the 
form's action and not after 'tutorial'.

Joe



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Tomcat error log: Element struts-config does not allow message-resource here

2002-04-11 Thread jfc100

Hi,

Tomcat3.2.3+JBoss2.4.1 on JDK1.3.1_01 on SuSE7.2 (2.4.13)
Struts1.0.2


I am getting the following error message on startup of my 
containers(only happens with 'tiles-doc.war' in tc/webapps):

.. startup of JBoss .
[Default] Starting tomcat. Check logs/tomcat.log for error messages
[sax] startDocument()
[sax] endDocument()
[sax] startDocument()
[Digester] Parse Error at line 219 column -1: Element struts-config 
does not allow message-resource here.
org.xml.sax.SAXParseException: Element struts-config does not allow 
message-resource here.
at org.apache.crimson.parser.Parser2.error(Parser2.java:3013)
at 
org.apache.crimson.parser.ValidatingParser$ChildrenValidator.consume(ValidatingParser.java:349)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1303)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at 
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at org.apache.commons.digester.Digester.parse(Digester.java:1299)
at 
org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:741)
at 
org.apache.struts.action.ActionServlet.init(ActionServlet.java:408)
at 
org.apache.struts.tiles.ActionComponentServlet.init(ActionComponentServlet.java:52)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at 
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at 
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at 
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
at 
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
at 
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.jboss.tomcat.TomcatEntry.execute(TomcatEntry.java:337)
at org.jboss.tomcat.TomcatEntry.init(TomcatEntry.java:76)
at 
org.jboss.tomcat.EmbeddedTomcatServiceSX.startService(EmbeddedTomcatServiceSX.java:91)
at 
org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:107)
at java.lang.reflect.Method.invoke(Native Method)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at 
org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:836)
at $Proxy0.start(Unknown Source)
at org.jboss.util.ServiceControl.start(ServiceControl.java:81)
at java.lang.reflect.Method.invoke(Native Method)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at 
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.Main.init(Main.java:210)
at org.jboss.Main$1.run(Main.java:116)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.Main.main(Main.java:112)
[Digester] Parse Error at line 219 column -1: Element type 
message-resource is not declared.
org.xml.sax.SAXParseException: Element type message-resource is not 
declared.
at org.apache.crimson.parser.Parser2.error(Parser2.java:3013)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1308)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at 
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at org.apache.commons.digester.Digester.parse(Digester.java:1299)
at 
org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:741)
at 
org.apache.struts.action.ActionServlet.init(ActionServlet.java:408)
at 
org.apache.struts.tiles.ActionComponentServlet.init(ActionComponentServlet.java:52)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at 
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at 
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at 
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
at 
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491)
at 
org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at 

Re: Tomcat error log: Element struts-config does not allow message-resource here

2002-04-11 Thread jfc100

Chuck Cavaness wrote:

 It's message-resources.  I think that yoy're missing the s 
 according to the error message.

 Chuck


 At 12:16 PM 4/11/2002 +, you wrote:

 Hi,

 Tomcat3.2.3+JBoss2.4.1 on JDK1.3.1_01 on SuSE7.2 (2.4.13)
 Struts1.0.2


 I am getting the following error message on startup of my 
 containers(only happens with 'tiles-doc.war' in tc/webapps):

 .. startup of JBoss .
 [Default] Starting tomcat. Check logs/tomcat.log for error messages
 [sax] startDocument()
 [sax] endDocument()
 [sax] startDocument()
 [Digester] Parse Error at line 219 column -1: Element struts-config 
 does not allow message-resource here.
 org.xml.sax.SAXParseException: Element struts-config does not allow 
 message-resource here.
at org.apache.crimson.parser.Parser2.error(Parser2.java:3013)
at 
 
org.apache.crimson.parser.ValidatingParser$ChildrenValidator.consume(ValidatingParser.java:349)
 

at 
 org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1303)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
at 
 org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
at 
 org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at 
 org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at org.apache.commons.digester.Digester.parse(Digester.java:1299)
at 
 
org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:741) 

at 
 org.apache.struts.action.ActionServlet.init(ActionServlet.java:408)
at 
 org.apache.struts.tiles.ActionComponentServlet.init(ActionComponentServlet.java:52) 

at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at 
 org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at 
 org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at 
 
org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:130)
 

at 
 org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:491) 

at 
 org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
at org.jboss.tomcat.TomcatEntry.execute(TomcatEntry.java:337)
at org.jboss.tomcat.TomcatEntry.init(TomcatEntry.java:76)
at 
 
org.jboss.tomcat.EmbeddedTomcatServiceSX.startService(EmbeddedTomcatServiceSX.java:91)
 

at 
 org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:107)
at java.lang.reflect.Method.invoke(Native Method)
at 
 com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at 
 com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at 
 
org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationService.java:836)
 

at $Proxy0.start(Unknown Source)
at org.jboss.util.ServiceControl.start(ServiceControl.java:81)
at java.lang.reflect.Method.invoke(Native Method)
at 
 com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
at 
 com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at org.jboss.Main.init(Main.java:210)
at org.jboss.Main$1.run(Main.java:116)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.Main.main(Main.java:112)
 [Digester] Parse Error at line 219 column -1: Element type 
 message-resource is not declared.
 org.xml.sax.SAXParseException: Element type message-resource is not 
 declared.
at org.apache.crimson.parser.Parser2.error(Parser2.java:3013)
at 
 org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1308)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1700)
at 
 org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1468)
at 
 org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at 
 org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at org.apache.commons.digester.Digester.parse(Digester.java:1299)
at 
 
org.apache.struts.action.ActionServlet.initApplicationConfig(ActionServlet.java:741) 

at 
 org.apache.struts.action.ActionServlet.init(ActionServlet.java:408)
at 
 org.apache.struts.tiles.ActionComponentServlet.init(ActionComponentServlet.java:52) 

at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at 
 org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at 
 org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at