RE: Using CheckLogin tag from within tiles

2002-10-07 Thread Andrew Hill

There is a small complication in that the users and roles often need to be
configurable from within the application by a user using the applications
UI.

ie: the users and roles (or to be more
precise:"role-group-like-things-wot-users-have") arent fixed and can be
changed during runtime. - The persistance of this info being handled by the
business layer rather than in the webApp - which doesnt have access to the
underlying database tables either.

Whats the 'best practice' for handling this sort of requirement (which I
imagine comes up a lot)?

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 08, 2002 14:49
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Using CheckLogin tag from within tiles




On Tue, 8 Oct 2002, Andrew Hill wrote:

>
> My (exceedingly limited) understanding of CMA was that it was very
container
> specific. If so what approach do you recomend for an app (accessing ejbs)
> which customers are to run in their own container, where at development
time
> one desnt know which container will be used?
>

To answer this question, you really need to think about what portion of
the problem is container-specific and what is not.  In the case of CMA,
the mechanism you use to set up users/groups/roles is container-specific,
but the application that you deploy is ***not*** container-specific.  Do
you see the difference?

All you need to do is configure users with the correct roles in both your
development environment and your production environment, and your app can
be appropriately tested, and then deployed with no changes to the WAR or
EAR itself.  That is because a WAR or EAR contains zero references to any
actual users - it only talks about roles and restrictions based on those
roles.  Authenticating users, and determining which roles they have, is
the container's problem -- not the application's problem.

> Is it better to ditch CMA and hope for the best from a home grown
solution,
> or to try and find the resources to write seperate versions of the app for
> each of the major containers?
>

Any application developer who thinks that he or she understands enough
about security (and all the possible things that can go wrong) to
implement application managed security safely is welcome to do so.  But
please warn me which publicly visible apps you've built, and I will make a
note not to use them.

I'm very serious about this.

If you don't have a fundamentally correct security implementation as an
overall top level goal (perfect security does not exist; it's all a matter
of how much you're willing to spend versus the risk/cost of security
breaches), you are wasting your time even bothering with it at all, unless
this is a trivially simple intranet app with no damaging implications if
your security scheme is bypassed by enterprising (or malicious) users.

> (Or tell em they can have any container so long as its Tomcat? (This would
> be my choice if I was dictator for life ;->))
>

Having been a Tomcat developer, I can tell you that even container managed
security cannot be trusted totally (despite how many hundreds of thousands
of times Tomcat has been downloaded, a long standing security
vulnerability was recently found (not with CMA in this case, but the
principle still applies).

But I will trust the container managed security implementation of any
widely deployed container a *lot* more than I will trust the application
managed security of any arbitrary application (including my own).  It is
very much worth the pain of having to be container-specific about
administering your user database to have some comfort in the fact that
better heads than yours has been involved in setting up your container's
authentication and authorization implementations.

You know the number one security-related question on TOMCAT-USER?  "How
can I authenicate my users using Windows security?"  Nobody even seems to
think about the security implications of sending usernames and passwords
across a network where people who are salivating to attack your server can
see it ...

Sheesh.

Craig (who subscribes to various security lists and is
   *astounded/scared to death* at how many vulnerabilities
continue to show up)


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Using CheckLogin tag from within tiles

2002-10-07 Thread David Graham

Craig,
I agree with most of your points but you must admit that the non-standard 
implementations of CMA are a pain.  Not really when you work for a company 
that sells a container (Sun, BEA, IBM) because you'll always be using 
their's, but when developing for a number of containers this can be painful.

It would help if at least one standard implementation was prescribed by the 
spec...I personally like tomcat's jdbc realm implementation.

Dave


>From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: Struts Users Mailing List <[EMAIL PROTECTED]>,  
><[EMAIL PROTECTED]>
>Subject: RE: Using CheckLogin tag from within tiles
>Date: Mon, 7 Oct 2002 23:48:38 -0700 (PDT)
>
>
>
>On Tue, 8 Oct 2002, Andrew Hill wrote:
>
> >
> > My (exceedingly limited) understanding of CMA was that it was very 
>container
> > specific. If so what approach do you recomend for an app (accessing 
>ejbs)
> > which customers are to run in their own container, where at development 
>time
> > one desnt know which container will be used?
> >
>
>To answer this question, you really need to think about what portion of
>the problem is container-specific and what is not.  In the case of CMA,
>the mechanism you use to set up users/groups/roles is container-specific,
>but the application that you deploy is ***not*** container-specific.  Do
>you see the difference?
>
>All you need to do is configure users with the correct roles in both your
>development environment and your production environment, and your app can
>be appropriately tested, and then deployed with no changes to the WAR or
>EAR itself.  That is because a WAR or EAR contains zero references to any
>actual users - it only talks about roles and restrictions based on those
>roles.  Authenticating users, and determining which roles they have, is
>the container's problem -- not the application's problem.
>
> > Is it better to ditch CMA and hope for the best from a home grown 
>solution,
> > or to try and find the resources to write seperate versions of the app 
>for
> > each of the major containers?
> >
>
>Any application developer who thinks that he or she understands enough
>about security (and all the possible things that can go wrong) to
>implement application managed security safely is welcome to do so.  But
>please warn me which publicly visible apps you've built, and I will make a
>note not to use them.
>
>I'm very serious about this.
>
>If you don't have a fundamentally correct security implementation as an
>overall top level goal (perfect security does not exist; it's all a matter
>of how much you're willing to spend versus the risk/cost of security
>breaches), you are wasting your time even bothering with it at all, unless
>this is a trivially simple intranet app with no damaging implications if
>your security scheme is bypassed by enterprising (or malicious) users.
>
> > (Or tell em they can have any container so long as its Tomcat? (This 
>would
> > be my choice if I was dictator for life ;->))
> >
>
>Having been a Tomcat developer, I can tell you that even container managed
>security cannot be trusted totally (despite how many hundreds of thousands
>of times Tomcat has been downloaded, a long standing security
>vulnerability was recently found (not with CMA in this case, but the
>principle still applies).
>
>But I will trust the container managed security implementation of any
>widely deployed container a *lot* more than I will trust the application
>managed security of any arbitrary application (including my own).  It is
>very much worth the pain of having to be container-specific about
>administering your user database to have some comfort in the fact that
>better heads than yours has been involved in setting up your container's
>authentication and authorization implementations.
>
>You know the number one security-related question on TOMCAT-USER?  "How
>can I authenicate my users using Windows security?"  Nobody even seems to
>think about the security implications of sending usernames and passwords
>across a network where people who are salivating to attack your server can
>see it ...
>
>Sheesh.
>
>Craig (who subscribes to various security lists and is
>*astounded/scared to death* at how many vulnerabilities
> continue to show up)
>
>
>--
>To unsubscribe, e-mail:   
>
>For additional commands, e-mail: 
>




_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: question

2002-10-07 Thread James Mitchell

Are you using html:base tag?

If so, make sure that you are not setting the target attribute.

James


-Original Message-
From: David Raphael [mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 07, 2002 8:13 PM
To: Struts Users Mailing List
Subject: Re:  question




Hope this helps
dave

On Monday, October 7, 2002, at 07:11 AM, deepank wrote:

> Hi,
> why does  open the link in a new window, how can i prevent
> this.
>
> Deepank


--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Using CheckLogin tag from within tiles

2002-10-07 Thread Craig R. McClanahan



On Tue, 8 Oct 2002, Andrew Hill wrote:

>
> My (exceedingly limited) understanding of CMA was that it was very container
> specific. If so what approach do you recomend for an app (accessing ejbs)
> which customers are to run in their own container, where at development time
> one desnt know which container will be used?
>

To answer this question, you really need to think about what portion of
the problem is container-specific and what is not.  In the case of CMA,
the mechanism you use to set up users/groups/roles is container-specific,
but the application that you deploy is ***not*** container-specific.  Do
you see the difference?

All you need to do is configure users with the correct roles in both your
development environment and your production environment, and your app can
be appropriately tested, and then deployed with no changes to the WAR or
EAR itself.  That is because a WAR or EAR contains zero references to any
actual users - it only talks about roles and restrictions based on those
roles.  Authenticating users, and determining which roles they have, is
the container's problem -- not the application's problem.

> Is it better to ditch CMA and hope for the best from a home grown solution,
> or to try and find the resources to write seperate versions of the app for
> each of the major containers?
>

Any application developer who thinks that he or she understands enough
about security (and all the possible things that can go wrong) to
implement application managed security safely is welcome to do so.  But
please warn me which publicly visible apps you've built, and I will make a
note not to use them.

I'm very serious about this.

If you don't have a fundamentally correct security implementation as an
overall top level goal (perfect security does not exist; it's all a matter
of how much you're willing to spend versus the risk/cost of security
breaches), you are wasting your time even bothering with it at all, unless
this is a trivially simple intranet app with no damaging implications if
your security scheme is bypassed by enterprising (or malicious) users.

> (Or tell em they can have any container so long as its Tomcat? (This would
> be my choice if I was dictator for life ;->))
>

Having been a Tomcat developer, I can tell you that even container managed
security cannot be trusted totally (despite how many hundreds of thousands
of times Tomcat has been downloaded, a long standing security
vulnerability was recently found (not with CMA in this case, but the
principle still applies).

But I will trust the container managed security implementation of any
widely deployed container a *lot* more than I will trust the application
managed security of any arbitrary application (including my own).  It is
very much worth the pain of having to be container-specific about
administering your user database to have some comfort in the fact that
better heads than yours has been involved in setting up your container's
authentication and authorization implementations.

You know the number one security-related question on TOMCAT-USER?  "How
can I authenicate my users using Windows security?"  Nobody even seems to
think about the security implications of sending usernames and passwords
across a network where people who are salivating to attack your server can
see it ...

Sheesh.

Craig (who subscribes to various security lists and is
   *astounded/scared to death* at how many vulnerabilities
continue to show up)


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Using CheckLogin tag from within tiles

2002-10-07 Thread Eddie Bush

Andrew Hill wrote:

>(Or tell em they can have any container so long as its Tomcat? (This would
>be my choice if I was dictator for life ;->))
>
LOL -  It's not friday yet!
(that was very good though :-)

-- 
Eddie Bush




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Using CheckLogin tag from within tiles

2002-10-07 Thread Andrew Hill

My (exceedingly limited) understanding of CMA was that it was very container
specific. If so what approach do you recomend for an app (accessing ejbs)
which customers are to run in their own container, where at development time
one desnt know which container will be used?

Is it better to ditch CMA and hope for the best from a home grown solution,
or to try and find the resources to write seperate versions of the app for
each of the major containers?

(Or tell em they can have any container so long as its Tomcat? (This would
be my choice if I was dictator for life ;->))

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 08, 2002 02:27
To: Struts Users Mailing List
Subject: Re: Using CheckLogin tag from within tiles




On Mon, 7 Oct 2002, Eddie Bush wrote:

> Date: Mon, 07 Oct 2002 12:22:23 -0500
> From: Eddie Bush <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: Using CheckLogin tag from within tiles
>
> Oh - one more thing.  Filters really are a lot more flexible in that
> they can be deployed with the application.  I've heard of instances
> where hosting providers wouldn't configure realms for folks (nor would
> they do anything else that required a server config change) - and that
> is where a Filter would become an absolute necessity!
>

One other thing to note about any non-CMA approach -- they don't help you
much (if at all) if you are accessing EJBs from your actions.  From the
point of view of the EJB container, all these requests will appear to be
from an unauthanticated user identity.  You can establish a 
identity in web.xml for these cases, but this applies to *all* EJB calls.

If you want the EJB layer to be able to make role-based access decisions
depending on who the logged in user is, you must use container managed
security.

> David Graham wrote:
>
> > I've never used CMA because of potential implementation differences
> > across containers.  Are those fears justified?  I have used the Filter
> > approach and found it to be easy and portable.
> >
> > Dave
>
> --
> Eddie Bush
>

Craig


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problem with Struts-Velocity Validator

2002-10-07 Thread Andrew Hill

I dont have any knowledge that might help with your problem (sorry), but if
you give some more details about these mysterious  "only errors" (and
perhaps some quick details of your configuration), it might allow someone
familiar with velocity-struts-validator usage to recognise your problem and
provide meaningful assistance.

-Original Message-
From: Rodrigo Arias L [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 08, 2002 06:45
To: [EMAIL PROTECTED]
Subject: Problem with Struts-Velocity Validator


Hi , I´m using struts with velocity and work fine, but I configure the
validator framework and I can get that it works.  All config is ok (like
the examples) but I just recieved only errors.

Thanks.


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: RedirectingActionForward?

2002-10-07 Thread Eddie Bush

I need to dig into the source more deeply.  I looked briefly but 
couldn't satisfy myself as to whether you could do a redirect that 
wasn't (at least) relative to the application.  Sorry, but this isn't an 
issue I've had to face.  As a last resort you could do:

response.sendRedirect(response.encodeUrl(path));
return null;

Returning null is very important, as it signals the RequestProcessor 
that it doesn't need to do anything else.

Hopefully someone else will have additional wisdom for you.

Angie Lin wrote:

> Trying again
>
> Anybody with clues on why RedirectingActionForward isn't redirecting? 
> This used to work in 1.0.2. 
>
> Angie Lin wrote:
>
>> Hi there,
>>
>> RedirectingActionForward doesn't seem to redirect anymore.  It's 
>> trying to forward and I'm ending up with a garbled URL like:
>>
>>http://localhost:7001/myapp/http://someothersite.com/
>>
>> My code is:
>>ActionForward oldfwd=mapping.findForward("othersite");
>>String path=oldfwd.getPath();
>>path.append("?id="+id);
>>RedirectingActionForward newfwd=new RedirectingActionForward(path);
>>return newfwd;
>>
>>
>> This used to work in 1.0.2, but I've since upgraded to 1.1b.   I'm 
>> also using WL6.1 if that helps at all. I've searched the archive and 
>> read the thread on message 38728, but that problem was fixed by 
>> setting the contextRelative attribute to true, which doesn't quite 
>> help me, since I'm trying to forward to another domain. Any other 
>> configuration settings I might be missing? 
>

-- 
Eddie Bush




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Problem reading ApplicationResources.properties..

2002-10-07 Thread Eddie Bush

Eddie Bush wrote:

> Are you running Struts version 1.0 or Struts version 1.1 bx?  In 1.1, 
> you specify your resources as you have noted - in 1.1 you specify them 
> differently.  An example would be: 

I'm sorry - that should read:  "In 1.0, you specify your resources as 
you have noted ..."

>   parameter="com.foo.config.ModuleResources"/>
>
> ... or, for your exact case:
>
>   parameter="EprojectsResources"/>
>
> That should be after the action-mappings section.  If you're not using 
> 1.1 I'm not quite sure what to tell you - I believe you have it listed 
> correctly (assuming you have the properties file in your top-level 
> classes directory)
>
> [EMAIL PROTECTED] wrote:
>
>> Hello all,
>>
>> I am having some trouble with my struts application.. It doesn't seem 
>> to be
>> reading the ApplicationResources.properties file and when my Actions 
>> generate
>> errors all I get from the output of my  tag is "null 
>> null". 
>
Sorry for any confusion my inability to type caused!

-- 
Eddie Bush




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: RedirectingActionForward?

2002-10-07 Thread Angie Lin

Trying again

Anybody with clues on why RedirectingActionForward isn't redirecting? 
 This used to work in 1.0.2.  



Angie Lin wrote:

> Hi there,
>
> RedirectingActionForward doesn't seem to redirect anymore.  It's 
> trying to forward and I'm ending up with a garbled URL like:
>
>http://localhost:7001/myapp/http://someothersite.com/
>
> My code is:
>ActionForward oldfwd=mapping.findForward("othersite");
>String path=oldfwd.getPath();
>path.append("?id="+id);
>RedirectingActionForward newfwd=new RedirectingActionForward(path);
>return newfwd;
>
>
> This used to work in 1.0.2, but I've since upgraded to 1.1b.   I'm 
> also using WL6.1 if that helps at all. 
> I've searched the archive and read the thread on message 38728, but 
> that problem was fixed by setting the contextRelative attribute to 
> true, which doesn't quite help me, since I'm trying to forward to 
> another domain. 
> Any other configuration settings I might be missing?
>
>

-- 
Angie Lin
[EMAIL PROTECTED]
408.519.9250



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Problem reading ApplicationResources.properties..

2002-10-07 Thread Eddie Bush

Are you running Struts version 1.0 or Struts version 1.1 bx?  In 1.1, 
you specify your resources as you have noted - in 1.1 you specify them 
differently.  An example would be:

  

... or, for your exact case:

  

That should be after the action-mappings section.  If you're not using 
1.1 I'm not quite sure what to tell you - I believe you have it listed 
correctly (assuming you have the properties file in your top-level 
classes directory)

[EMAIL PROTECTED] wrote:

>Hello all,
>
>I am having some trouble with my struts application.. It doesn't seem to be
>reading the ApplicationResources.properties file and when my Actions generate
>errors all I get from the output of my  tag is "null null".
>

-- 
Eddie Bush




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Problem reading ApplicationResources.properties..

2002-10-07 Thread smaccutchan


Hello again continuation from my previous message, hit the wrong button..



my EngJobBO.updateEngJob(engJob):

public void updateEngJob(EngJob engJob)
  throws EngJobException {

  validate(engJob);

  Connection con = null;

  try {
con = pool.getConnection();

EngJobDAO engJobDAO = new EngJobDAO(con);
engJobDAO.update(engJob);

con.commit();
  } catch(Exception e) {
try {
  if(con != null) {
con.rollback();
throw new EngJobException(e.getMessage());
  }
} catch(SQLException sqle) {
  sqle.printStackTrace();
  throw new RuntimeException("error.unexpected");
}
  } finally {
try {
  if(con != null) {
con.close();
  }
} catch(SQLException sqlee) {
  sqlee.printStackTrace();
  throw new RuntimeException("error.unexpected");
}
  }
}

I hope that I have included enough information that someone can actually suggest
some solutions.. It is really annoying this is the final bug in my program and
the fact that the error is not displaying a usefull error message is driving me
crazy!

Thanks for your time and any suggestions you might have..

Sam MacCutchan
Jr. Business Systems Analyst
Sinclair Technologies Inc.




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Problem reading ApplicationResources.properties..

2002-10-07 Thread smaccutchan

Hello all,

I am having some trouble with my struts application.. It doesn't seem to be
reading the ApplicationResources.properties file and when my Actions generate
errors all I get from the output of my  tag is "null null".

Here is a portion from my web.xml:


  action
  org.apache.struts.action.ActionServlet
  
application
EprojectsResources
  
  
config
/WEB-INF/struts-config.xml
  
  2


My EprojectsResources.properties file lives in
$TOMCAT_HOME/webapps/eprojects/WEB-INF/classes

My struts-config.xml:


  

  

  

 



 



  



(I ommitted the action mapping for listAllProjects.do to save typing, but it is
there)

The action that is returning the "null null" is the updateEngJob action..
Basically I can list the projects and edit them, but when I submit the form the
updateEngJob action returns the error "null null"

Some code from my UpdateEngJobAction.java class file:

import net.sinctech.eprojects.entity.EngJob;

public class UpdateEngJobAction extends Action {
  public ActionForward perform(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
  throws IOException, ServletException {

ActionErrors errors = new ActionErrors();

try {
  EngJobBO engJobBO = new EngJobBO();
  EngJob engJob = (EngJob)form;
  engJobBO.updateEngJob(engjob);

  return mapping.findForward("success");
} catch(Throwable e) {
  e.printStackTrace();
  ActionError error = new ActionError(e.getMessage());
  errors.add(ActionErrors.GLOBAL_ERROR, error);
}
saveErrors(request, errors);
return new ActionForward(mapping.getInput());
  }
}

my EngJobBO.updateEngJob(engJob):

public void updateEngJob(EngJob engJob)
  throws EngJobException {

  validate(engJob);

  Connection con = null;

  try {
con = pool.getConnection();

EngJobDAO engJobDAO = new EngJobDAO(con);
engJobDAO.update(engJob);

con.commit();
  } catch(Exception e) {
try {
  if(con != null) {
con.rollback();
throw new EngJobException(e.getMessage());
  }
} catch(SQLException sqle) {




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Is this possible?

2002-10-07 Thread Joe Barefoot

>From what I see, there's no logic in your popup to populate the form field (the 
>Explanation) in your opening window.  You need to pass in the id of the explanation 
>field so you can populate it when the popup is closed:

Your function needs to accept a 'fieldName' argument and then do something like this 
when you hit the close button:

onClick=opener.document.getElementById(fieldName).value = 
this.document.getElementById(overrideExp).value; window.close


Since you're using the nested tags, you'll have to figure out what names it gives the 
fields in the generated HTML so you can pass those in to the JavaScript function.  I'm 
guessing it does something like:  gridArray[i].overrideExp


peace,
Joe



> -Original Message-
> From: Rea, Ron [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 4:46 PM
> To: '[EMAIL PROTECTED]'
> Subject: Is this possible?
> 
> 
> Hello, 
> I'm not sure if this is possible from within a 
>  tag, any
> help would be greatly appreciated!
>  
> From within my JSP, I am iterating through several rows of data and
> displaying the data for modification.  One specific property is an
> Explanation field.  What I'd like to do is create a "memo" 
> link on each row
> of data, and when that link is hit, a small page is displayed 
> with only that
> rows Explanation data.  The user enters up to 300 bytes of 
> data for their
> Explanation, within the pop-up, and when they close the 
> pop-up, the specific
> rows Explanation property is updated within the 
>  section.   
>  
> I can create the pop-up, but after I enter the data, the rows 
> Explanation
> property is not updated.  Any ideas?  Is this possible?
>  
> Thanks!
>  
> Example of code:
>  
> JSP:
> 
>  filter="true"/> 
> 
>  value="A"/>Approve
>  value="D"/>Deny
> 
> 
> 
> ' ,' property="msgCode"
> filter="true"/>');" onMouseOver="window.status='Click to 
> enter an Override
> Explanation...';return true;" onMouseOut="window.status='';return
> true;">memo
> 
>   
>   
>  
> Javascript:
> 
> function getText(name, output, msg, dataValue, msgKey) {
> newwin = window.open('','','top=150,left=150,width=325,height=330');
> if (!newwin.opener) newwin.opener = self;
> with (newwin.document)
> {
> open();
> write('');
> write('
name=form>' + msg + > '
'); > write('

Message Code: ' + msgKey + ''); > write('

'); > write('

onClick=window.close()>'); > write('

'); > close(); >} > } > > > -- To unsubscribe, e-mail: For additional commands, e-mail:

Help with displaying contents of a List contained within a bean

2002-10-07 Thread Wendy Smoak


I'm plodding along, coding Value Objects and DAO stuff.  I've got a
ResolutionView object, which contains a Person, Address, etc.  I have this:



  

  


  

 
  

  



The only problem is that resView.getPreferredAddress() actually returns a
List, so the above bean:write tag produces something like: [123 State
Street, Phoenix AZ 12345] which is produced by the toString() method of the
List.

How do I work with the List instead of using bean:write?  I know how to do
it in Java, getting the iterator and iterating to get each value, which in
this case is a line of the address.  Do I need another logic:iterate tag?
(But the "bean" I need isn't in scope, it's inside the current resView
bean!).  An example would be appreciated-- I'm stuck.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management



Re: question

2002-10-07 Thread David Raphael



Hope this helps
dave

On Monday, October 7, 2002, at 07:11 AM, deepank wrote:

> Hi,
> why does  open the link in a new window, how can i prevent 
> this.
>
> Deepank


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Is this possible?

2002-10-07 Thread Rea, Ron

Hello, 
I'm not sure if this is possible from within a  tag, any
help would be greatly appreciated!
 
>From within my JSP, I am iterating through several rows of data and
displaying the data for modification.  One specific property is an
Explanation field.  What I'd like to do is create a "memo" link on each row
of data, and when that link is hit, a small page is displayed with only that
rows Explanation data.  The user enters up to 300 bytes of data for their
Explanation, within the pop-up, and when they close the pop-up, the specific
rows Explanation property is updated within the  section.   
 
I can create the pop-up, but after I enter the data, the rows Explanation
property is not updated.  Any ideas?  Is this possible?
 
Thanks!
 
Example of code:
 
JSP:

 

Approve
Deny



' ,'');" onMouseOver="window.status='Click to enter an Override
Explanation...';return true;" onMouseOut="window.status='';return
true;">memo

  
  
 
Javascript:

function getText(name, output, msg, dataValue, msgKey) {
newwin = window.open('','','top=150,left=150,width=325,height=330');
if (!newwin.opener) newwin.opener = self;
with (newwin.document)
{
open();
write('');
write('
' + msg + '
'); write('

Message Code: ' + msgKey + ''); write('

'); write('

'); write('

'); close(); } }

Problem with Struts-Velocity Validator

2002-10-07 Thread Rodrigo Arias L

Hi , I´m using struts with velocity and work fine, but I configure the 
validator framework and I can get that it works.  All config is ok (like 
the examples) but I just recieved only errors.

Thanks.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Using Frameset within Struts - displayed a blank page

2002-10-07 Thread Tuan H. Le

Hi Brian,

Thanks for your response! I tried to define a forward within the /selectTab action, 
but I still see a blank page. The new action mapping is below





Read the Struts archive, it seems that using tiles/template is a better choice than 
calling in action in the frame src attribute.

Also, it would be much appreciated if some one can share a sample code and 
configuration on how to develop tabs functionality with frame and tiles. I'm going 
through tiles-documentation tutorial. 

The layout that we have for our application is below

Top frame: Tab labels
Middle frame: content body
Bottom frame: other data and footer.

Thanks!
Tuan

-Original Message-
From: Brian DeLuca [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 1:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Using Frameset within Struts - displayed a blank page




Interesting.  Never tried calling in action in a SRC attribute.  Seems like it works 
since you are getting a blank page, and not a HTTP: 404 error ( Page not found ).

When I see blank white pages it is usually a problem with your forwards.  I don't see 
a forward defined in the selectTab action definition in the Struts-config file.
Is it a Global forward? is it misspelled in your code?  

Keeping in mind that the input attribute doesn't get checked for forwards, that is 
used for validation.

hth
b-

 --- On Mon 10/07, Tuan H. Le  wrote:
From: Tuan H. Le [mailto: [EMAIL PROTECTED]]
To: [EMAIL PROTECTED]
Date: Mon, 7 Oct 2002 12:08:44 -0700
Subject: Using Frameset within Struts - displayed a blank page

> I have searched through the struts archive, but couldn't find a solution to
> my problem below. 
> 
> if I specified , it found and
> displayed the Top.jsp fine.
>  id="top" frameborder="0" scrolling="no"
> noresize marginwidth="0" marginheight="0"
> framespacing="0">
> However, after I changed to ,
> then it displayed a blank page in the top frame.
> 
> Do you know what I'm missing?
> 
> Thanks in advance
> Tuan
> 
> Here are my settings and code.
> 
>  struts-config.xml (a partial file) --
>   
>  type="com.phs.ezhr.presentation.form.LoginForm" />
>  type="com.phs.ezhr.presentation.form.MainMenuForm" />
>   
>   
> 
> type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
> 
> 
>  MainMenu.jsp -
> 
> 
>  prefix="html" %>
>  prefix="bean" %>
> 
> 
> 
> 
> 
>  />
> 
> 
>  framespacing="0">
>  id="top" frameborder="0" scrolling="no"
> noresize marginwidth="0" marginheight="0"
> framespacing="0">
> 
>  marginwidth="0" marginheight="0"
> scrolling="yes" frameborder="0" noresize
> framespacing="0">
>  marginwidth="10" marginheight="10"
> scrolling="no" frameborder="0" noresize
> framespacing="0">
> 
>  id="btm" frameborder="0" scrolling="no"
> marginwidth="0" marginheight="0" noresize
> framespacing="0">
> 
> 
> 
> 
> 
> 
>  Top.jsp -
> 
> 
>  prefix="html" %>
>  prefix="bean" %>
>  prefix="logic" %>
> 
> 
> 
>  Transitional//EN">
> 
>  href="stylesheets/styleTop.css">
> 
> 
>/>
> 
> 
>  // get the passed in request parameter
> String value = request.getParameter( IConstants.USER_SEL_TAB_KEY );
> // set the request attribute to be used within the  JSP
> tag
> request.setAttribute( IConstants.USER_SEL_TAB_KEY, value );
> %>
> 
>name="mainMenuForm"
>   type="com.phs.ezhr.presentation.form.MainMenuForm"
>   method="POST">
>  cellspacing="0" cellpadding="0">
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 


Changed your e-mail?  Keep your contacts!  Use this free e-mail change of address 
service from Return Path.  Register now!

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: question

2002-10-07 Thread Brian DeLuca

 
Instead of using the page attribute why not use the HREF attribute.  

This should work more to you liking.

html:link href="reviewTeam.do"  

hth
b-


 --- On Mon 10/07, Buchwald, Dave (PLC, IT, Tri-Com Consulting)  wrote:
From: Buchwald, Dave (PLC, IT, Tri-Com Consulting) [mailto: 
[EMAIL PROTECTED]]
To: [EMAIL PROTECTED]
Date: Mon, 7 Oct 2002 09:07:19 -0400 
Subject: RE:  question

> I'm on NT, but try...
> 
> for IE V5.5 try:  'Internet options', 'Advanced' tab, check the 'Reuse
> windows for launching shortcuts'
> for Mozilla V1.0 (sorry, best I could do but there should be something
> similar for Netscape):
> 'Advanced', 'Scripts and Windows', uncheck 'Open a link in a new window'
> 
> 
> 
> -Original Message-
> From: deepank [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 8:32 AM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: Re:  question
> 
> 
> Hi,
> 
> This is how i am using the  tag for all my links
> invoking
> different actions
> 
> [Form Review
> Team]
> As u can see there is no use of "target" attribute
> 
> Funny part is that for all my links it opens a new window, if i keep the
> new
> window open, all the links then open in this new window
> That means i always have 2 windows open if i click on a link.
> Is there some browser setting i need to check, i use IE5.5  and Netscape
> 6.2
> 
> Deepank
> 
> 
> - Original Message -
> From: "Andrew Hill" 
> To: "Struts Users Mailing List"
> 
> Sent: Monday, October 07, 2002 5:40 PM
> Subject: RE:  question
> 
> 
> > Wierd. Is it just for your struts app, or does any link in your
> browser do
> > this (ie: some dodgy browser setting).
> > If the former, take a look at what you have specified for your
> target
> > attribute (if in doubt check the generated html of your page to see
> what
> is
> > really output to browser). If that window/frame does not exist the
> browser
> > will open a new one.
> >
> > -Original Message-
> > From: deepank [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 07, 2002 20:12
> > To: Struts Users Mailing List
> > Subject:  question
> >
> >
> > Hi,
> > why does  open the link in a new window, how can i
> prevent
> this.
> >
> > Deepank
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> This communication, including attachments, is for the exclusive use of 
> addressee and may contain proprietary, confidential or privileged 
> information. If you are not the intended recipient, any use, copying, 
> disclosure, dissemination or distribution is strictly prohibited. If 
> you are not the intended recipient, please notify the sender 
> immediately by return email and delete this communication and destroy all
> copies.
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 
> 


Changed your e-mail?  Keep your contacts!  Use this free e-mail change of address 
service from Return Path.  Register now!



RE: Using Frameset within Struts - displayed a blank page

2002-10-07 Thread Brian DeLuca



Interesting.  Never tried calling in action in a SRC attribute.  Seems like it works 
since you are getting a blank page, and not a HTTP: 404 error ( Page not found ).

When I see blank white pages it is usually a problem with your forwards.  I don't see 
a forward defined in the selectTab action definition in the Struts-config file.
Is it a Global forward? is it misspelled in your code?  

Keeping in mind that the input attribute doesn't get checked for forwards, that is 
used for validation.

hth
b-

 --- On Mon 10/07, Tuan H. Le  wrote:
From: Tuan H. Le [mailto: [EMAIL PROTECTED]]
To: [EMAIL PROTECTED]
Date: Mon, 7 Oct 2002 12:08:44 -0700
Subject: Using Frameset within Struts - displayed a blank page

> I have searched through the struts archive, but couldn't find a solution to
> my problem below. 
> 
> if I specified , it found and
> displayed the Top.jsp fine.
>  id="top" frameborder="0" scrolling="no"
> noresize marginwidth="0" marginheight="0"
> framespacing="0">
> However, after I changed to ,
> then it displayed a blank page in the top frame.
> 
> Do you know what I'm missing?
> 
> Thanks in advance
> Tuan
> 
> Here are my settings and code.
> 
>  struts-config.xml (a partial file) --
>   
>  type="com.phs.ezhr.presentation.form.LoginForm" />
>  type="com.phs.ezhr.presentation.form.MainMenuForm" />
>   
>   
> 
> type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
> 
> 
>  MainMenu.jsp -
> 
> 
>  prefix="html" %>
>  prefix="bean" %>
> 
> 
> 
> 
> 
>  />
> 
> 
>  framespacing="0">
>  id="top" frameborder="0" scrolling="no"
> noresize marginwidth="0" marginheight="0"
> framespacing="0">
> 
>  marginwidth="0" marginheight="0"
> scrolling="yes" frameborder="0" noresize
> framespacing="0">
>  marginwidth="10" marginheight="10"
> scrolling="no" frameborder="0" noresize
> framespacing="0">
> 
>  id="btm" frameborder="0" scrolling="no"
> marginwidth="0" marginheight="0" noresize
> framespacing="0">
> 
> 
> 
> 
> 
> 
>  Top.jsp -
> 
> 
>  prefix="html" %>
>  prefix="bean" %>
>  prefix="logic" %>
> 
> 
> 
>  Transitional//EN">
> 
>  href="stylesheets/styleTop.css">
> 
> 
>/>
> 
> 
>  // get the passed in request parameter
> String value = request.getParameter( IConstants.USER_SEL_TAB_KEY );
> // set the request attribute to be used within the  JSP
> tag
> request.setAttribute( IConstants.USER_SEL_TAB_KEY, value );
> %>
> 
>name="mainMenuForm"
>   type="com.phs.ezhr.presentation.form.MainMenuForm"
>   method="POST">
>  cellspacing="0" cellpadding="0">
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 


Changed your e-mail?  Keep your contacts!  Use this free e-mail change of address 
service from Return Path.  Register now!

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Any Idea about Paging Logic

2002-10-07 Thread Ashish Kulkarni

Hi, here is tag lib which i am using in my project,
and this taglib helps in getting results like google
search enging
http://jsptags.com/tags/navigation/pager/pager-taglib-1.1.html
hope this helps
Ashish

--- Joe Barefoot <[EMAIL PROTECTED]> wrote:
> Used the taglib a bit at my last gig, never noticed
> the behavior you're describing.  One thing to note: 
> The Collection the taglib sorts is stored in the
> session.  Did both of your "users" happen to belong
> to the same session somehow?  If so, then that's the
> behavior you would see.
> 
> peace,
> Joe
> 
> > -Original Message-
> > From: Brian Alexander Lee
> [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, October 06, 2002 7:42 PM
> > To: Struts Users Mailing List
> > Subject: Re: Any Idea about Paging Logic
> > 
> > 
> > I looked at the display tag library:
> > http://edhill.its.uiowa.edu/display/
> > 
> > Did I majorly screw something up or is this tag
> not thread 
> > safe? I noticed
> > when I sorted a page of data, the next user to hit
> the page 
> > got that default
> > sort. It was quite infuriating. I hope it was just
> me.
> > 
> > BAL
> > 
> > - Original Message -
> > From: "Eddie Bush" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> > Sent: Sunday, October 06, 2002 2:32 AM
> > Subject: Re: Any Idea about Paging Logic
> > 
> > 
> > > Is there any chance you've already searched the
> archive?  I 
> > generally
> > > skip that and go to Google, myself.  Tried that?
> > >
> > >
>
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=Struts+Paging
> > >
> > > There was a recent discussion on the list about
> paging that ... got
> > > pretty involved and contained some good
> suggestions.  If all other
> > > avenues fail, search the archive within the last
> ... 2 weeks max I'd
> > > say.  This is been a very, very discussed topic.
> > >
> > > Kalaiselvan wrote:
> > >
> > > >Hii all,
> > > >
> > > >  I'm using struts for my application. I
> have reterive 
> > data from DB
> > and
> > > >shown in table. Where i have thousands of
> records in my 
> > DB. So i want to
> > > >show the data 100 for each page. I'm using
>  tag for
> > > >displaying the data. Where how can i seperate
> the data and how can
> > implement
> > > >my requirement. Any idea will be more helpful
> for me.
> > > >
> > > >Thanx in Advance,
> > > >Kalaiselvan
> > > >
> > > --
> > > Eddie Bush
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> 
> > > For additional commands, e-mail:
> > 
> > >
> > 
> > --
> > To unsubscribe, e-mail:   
> 
> For additional commands, e-mail:
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


=
A$HI$H

__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Any Idea about Paging Logic

2002-10-07 Thread Joe Barefoot

Used the taglib a bit at my last gig, never noticed the behavior you're describing.  
One thing to note:  The Collection the taglib sorts is stored in the session.  Did 
both of your "users" happen to belong to the same session somehow?  If so, then that's 
the behavior you would see.

peace,
Joe

> -Original Message-
> From: Brian Alexander Lee [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 06, 2002 7:42 PM
> To: Struts Users Mailing List
> Subject: Re: Any Idea about Paging Logic
> 
> 
> I looked at the display tag library:
> http://edhill.its.uiowa.edu/display/
> 
> Did I majorly screw something up or is this tag not thread 
> safe? I noticed
> when I sorted a page of data, the next user to hit the page 
> got that default
> sort. It was quite infuriating. I hope it was just me.
> 
> BAL
> 
> - Original Message -
> From: "Eddie Bush" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Sunday, October 06, 2002 2:32 AM
> Subject: Re: Any Idea about Paging Logic
> 
> 
> > Is there any chance you've already searched the archive?  I 
> generally
> > skip that and go to Google, myself.  Tried that?
> >
> > http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=Struts+Paging
> >
> > There was a recent discussion on the list about paging that ... got
> > pretty involved and contained some good suggestions.  If all other
> > avenues fail, search the archive within the last ... 2 weeks max I'd
> > say.  This is been a very, very discussed topic.
> >
> > Kalaiselvan wrote:
> >
> > >Hii all,
> > >
> > >  I'm using struts for my application. I have reterive 
> data from DB
> and
> > >shown in table. Where i have thousands of records in my 
> DB. So i want to
> > >show the data 100 for each page. I'm using  tag for
> > >displaying the data. Where how can i seperate the data and how can
> implement
> > >my requirement. Any idea will be more helpful for me.
> > >
> > >Thanx in Advance,
> > >Kalaiselvan
> > >
> > --
> > Eddie Bush
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> 
> --
> To unsubscribe, e-mail:   

For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Using Frameset within Struts - displayed a blank page

2002-10-07 Thread Tuan H. Le

I have searched through the struts archive, but couldn't find a solution to my problem 
below. 

if I specified , it found and displayed the Top.jsp fine.

However, after I changed to , then it displayed a blank 
page in the top frame.

Do you know what I'm missing?

Thanks in advance
Tuan

Here are my settings and code.

 struts-config.xml (a partial file) --
  


  
  




 MainMenu.jsp -

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>





















 Top.jsp -

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%@ page import="com.phs.ezhr.constant.IConstants" %>









<%
// get the passed in request parameter
String value = request.getParameter( IConstants.USER_SEL_TAB_KEY );
// set the request attribute to be used within the  JSP tag
request.setAttribute( IConstants.USER_SEL_TAB_KEY, value );
%>















<>
--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RedirectingActionForward?

2002-10-07 Thread Angie Lin

Hi there,

RedirectingActionForward doesn't seem to redirect anymore.  It's trying 
to forward and I'm ending up with a garbled URL like:

http://localhost:7001/myapp/http://someothersite.com/

My code is:
ActionForward oldfwd=mapping.findForward("othersite");
String path=oldfwd.getPath();
path.append("?id="+id);
RedirectingActionForward newfwd=new RedirectingActionForward(path);
return newfwd;


This used to work in 1.0.2, but I've since upgraded to 1.1b.   I'm also 
using WL6.1 if that helps at all.  

I've searched the archive and read the thread on message 38728, but that 
problem was fixed by setting the contextRelative attribute to true, 
which doesn't quite help me, since I'm trying to forward to another 
domain.  

Any other configuration settings I might be missing?


-- 
Angie Lin



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Using CheckLogin tag from within tiles

2002-10-07 Thread Craig R. McClanahan



On Mon, 7 Oct 2002, Eddie Bush wrote:

> Date: Mon, 07 Oct 2002 12:22:23 -0500
> From: Eddie Bush <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: Using CheckLogin tag from within tiles
>
> Oh - one more thing.  Filters really are a lot more flexible in that
> they can be deployed with the application.  I've heard of instances
> where hosting providers wouldn't configure realms for folks (nor would
> they do anything else that required a server config change) - and that
> is where a Filter would become an absolute necessity!
>

One other thing to note about any non-CMA approach -- they don't help you
much (if at all) if you are accessing EJBs from your actions.  From the
point of view of the EJB container, all these requests will appear to be
from an unauthanticated user identity.  You can establish a 
identity in web.xml for these cases, but this applies to *all* EJB calls.

If you want the EJB layer to be able to make role-based access decisions
depending on who the logged in user is, you must use container managed
security.

> David Graham wrote:
>
> > I've never used CMA because of potential implementation differences
> > across containers.  Are those fears justified?  I have used the Filter
> > approach and found it to be easy and portable.
> >
> > Dave
>
> --
> Eddie Bush
>

Craig


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread Taylor, Jason

what about extending your existing Exception classes?  You could make your
existing ones interfaces or abstract classes that are used by the as is
software, and the extending classes are there more or less just to indicate
differences to the declarative exception handler.  That way, you can use
Struts 1.1b2 right-out-of-the-box and you benefit from forward compatibility
with later releases of 1.1.  I think it's always nicer to use polymorphism
than special flags, etc.  Make sense?

-Original Message-
From: Harvinder Singh [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 10:37 AM
To: Struts Users Mailing List
Subject: RE: Declarative Exception handling with Struts 1.1-b2


Thanks Chuck.

Regards,
Harvinder

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 11:00 PM
To: Struts Users Mailing List
Subject: RE: Declarative Exception handling with Struts 1.1-b2


Yea, you can't use the same exception class for 
different exception elements. The RequestProcessor looks 
up the exception element to use based on the exception  
type. You would need to have different exceptions 
specified in the "type" attribute for each exception 
element.

Here's a thought. Extend the RequestProcessor and 
override the processException() method. The exception 
object is one of the arguments in the method. Use the 
exception to get your specific exception code.

Then create your own ExceptionHandler that uses the 
exception code to lookup the proper key and creates the 
ActionError and stores it. 

So, you might have to extend 2 classes, but it should be 
very little work to do this and modify the behavior.

Someone else may have a better idea, but this shouldn't 
be that bad. Again, the only reason the framework can't 
do this for you is because you have the same exception 
class for different exception types.

Chuck
> Chuck,
> 
> I have already tried that but I wonder if it works. In my case
struts-config
> looks like below.  
> 
>  key="service.id.null"
> type="java.myexception.GenericException"
> path="/error.jsp"/>   
> key="template.id.null"
> type="java.myexception.GenericException"
> path="/error.jsp"/>
> 
>  
> 
> Now whenever java.myexception.GenericException is thrown, the message
> corresponding to last entry is getting displayed, i.e., message
corresponding
> to "template.id.null" key. Please correct me if I am wrong.
> 
> -Harvinder
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 10:06 PM
> To: Struts Users Mailing List
> Subject: RE: Declarative Exception handling with Struts 1.1-b2
> 
> 
> Ah, I see the confusion. The Struts framework will use 
> the value from the "key" attribute in the exception 
> element to automatically build ActionErrors for you. You 
> just need to use the  tag to display them.
> 
> To see where in the framework all of this takes place, 
> check out the source code for the ExceptionHandler class.
> 
> Hope this helps,
> 
> Chuck
> > Thanks Chuck,
> > 
> > Actually we are porting existing code and hence there are pre defined
set
> of
> > Exception classes and we have decided not to add any more exception
> classes.
> > We are using error code to identify the exact problem.
> > 
> > >In your case, since you want all errors to go to the same 
> > >page, the path attribute would be "error.jsp" for all of 
> > >your exception elements. 
> > 
> > I agreed that I can define path variables for all the keys to
"error.jsp",
> > like
> > 
> >  > key="name.not.found"
> > type="com.myexception.ServiceException"
> > path="/error.jsp"/>   
> > 
> >   > key="name.system.error"
> > type="com.myexception.SystemException"
> > path="/error.jsp"/>
> > 
> > 
> > 
> > But how do I fetch corresponding error message in my "error.jsp" file.
> Don't
> > I need to hardcode the "key" in the "error.jsp" like below. If not,
please
> > point out how do I do it.
> > 
> > --
> > <%@ page language="java" %>
> > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> > 
> > 
> > 
> > 
> > Error Message is :-  
> > 
> > 
> > 
> > ---
> > 
> > Thanks,
> > Harvinder
> > 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 07, 2002 8:44 PM
> > To: Struts Users Mailing List
> > Subject: RE: Declarative Exception handling with Struts 1.1-b2
> > 
> > 
> > I may be misunderstanding your situation completely. If 
> > I have, I apologize ahead of time. Here's the short 
> > version of what I think.
> > 
> > Can you not throw mo

RE: Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread Harvinder Singh

Thanks Chuck.

Regards,
Harvinder

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 11:00 PM
To: Struts Users Mailing List
Subject: RE: Declarative Exception handling with Struts 1.1-b2


Yea, you can't use the same exception class for 
different exception elements. The RequestProcessor looks 
up the exception element to use based on the exception  
type. You would need to have different exceptions 
specified in the "type" attribute for each exception 
element.

Here's a thought. Extend the RequestProcessor and 
override the processException() method. The exception 
object is one of the arguments in the method. Use the 
exception to get your specific exception code.

Then create your own ExceptionHandler that uses the 
exception code to lookup the proper key and creates the 
ActionError and stores it. 

So, you might have to extend 2 classes, but it should be 
very little work to do this and modify the behavior.

Someone else may have a better idea, but this shouldn't 
be that bad. Again, the only reason the framework can't 
do this for you is because you have the same exception 
class for different exception types.

Chuck
> Chuck,
> 
> I have already tried that but I wonder if it works. In my case
struts-config
> looks like below.  
> 
>  key="service.id.null"
> type="java.myexception.GenericException"
> path="/error.jsp"/>   
> key="template.id.null"
> type="java.myexception.GenericException"
> path="/error.jsp"/>
> 
>  
> 
> Now whenever java.myexception.GenericException is thrown, the message
> corresponding to last entry is getting displayed, i.e., message
corresponding
> to "template.id.null" key. Please correct me if I am wrong.
> 
> -Harvinder
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 10:06 PM
> To: Struts Users Mailing List
> Subject: RE: Declarative Exception handling with Struts 1.1-b2
> 
> 
> Ah, I see the confusion. The Struts framework will use 
> the value from the "key" attribute in the exception 
> element to automatically build ActionErrors for you. You 
> just need to use the  tag to display them.
> 
> To see where in the framework all of this takes place, 
> check out the source code for the ExceptionHandler class.
> 
> Hope this helps,
> 
> Chuck
> > Thanks Chuck,
> > 
> > Actually we are porting existing code and hence there are pre defined set
> of
> > Exception classes and we have decided not to add any more exception
> classes.
> > We are using error code to identify the exact problem.
> > 
> > >In your case, since you want all errors to go to the same 
> > >page, the path attribute would be "error.jsp" for all of 
> > >your exception elements. 
> > 
> > I agreed that I can define path variables for all the keys to
"error.jsp",
> > like
> > 
> >  > key="name.not.found"
> > type="com.myexception.ServiceException"
> > path="/error.jsp"/>   
> > 
> >   > key="name.system.error"
> > type="com.myexception.SystemException"
> > path="/error.jsp"/>
> > 
> > 
> > 
> > But how do I fetch corresponding error message in my "error.jsp" file.
> Don't
> > I need to hardcode the "key" in the "error.jsp" like below. If not,
please
> > point out how do I do it.
> > 
> > --
> > <%@ page language="java" %>
> > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> > 
> > 
> > 
> > 
> > Error Message is :-  
> > 
> > 
> > 
> > ---
> > 
> > Thanks,
> > Harvinder
> > 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 07, 2002 8:44 PM
> > To: Struts Users Mailing List
> > Subject: RE: Declarative Exception handling with Struts 1.1-b2
> > 
> > 
> > I may be misunderstanding your situation completely. If 
> > I have, I apologize ahead of time. Here's the short 
> > version of what I think.
> > 
> > Can you not throw more specific exceptions, ones that 
> > imply a little more about what went wrong? Then setup 
> > exception elements in the global section (or in the 
> > Action mappings if they are specific to the Action) and 
> > configure the application resource key for that specific 
> > exception.
> > 
> > I'm sure you understand this, but let me emphasize 
> > anyway, the point of declarative exception handling is 
> > that you shouldn't have to do anything programmatically 
> > to display errors. You specify what the error page is 
> > using the "path" attribute in the exception element. In 
> > your case, since you want all errors to go to the same 
> > page, the path attribute would be "error.js

RE: Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread chuckcavaness

Yea, you can't use the same exception class for 
different exception elements. The RequestProcessor looks 
up the exception element to use based on the exception  
type. You would need to have different exceptions 
specified in the "type" attribute for each exception 
element.

Here's a thought. Extend the RequestProcessor and 
override the processException() method. The exception 
object is one of the arguments in the method. Use the 
exception to get your specific exception code.

Then create your own ExceptionHandler that uses the 
exception code to lookup the proper key and creates the 
ActionError and stores it. 

So, you might have to extend 2 classes, but it should be 
very little work to do this and modify the behavior.

Someone else may have a better idea, but this shouldn't 
be that bad. Again, the only reason the framework can't 
do this for you is because you have the same exception 
class for different exception types.

Chuck
> Chuck,
> 
> I have already tried that but I wonder if it works. In my case struts-config
> looks like below.  
> 
>  key="service.id.null"
> type="java.myexception.GenericException"
> path="/error.jsp"/>   
> key="template.id.null"
> type="java.myexception.GenericException"
> path="/error.jsp"/>
> 
>  
> 
> Now whenever java.myexception.GenericException is thrown, the message
> corresponding to last entry is getting displayed, i.e., message corresponding
> to "template.id.null" key. Please correct me if I am wrong.
> 
> -Harvinder
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 10:06 PM
> To: Struts Users Mailing List
> Subject: RE: Declarative Exception handling with Struts 1.1-b2
> 
> 
> Ah, I see the confusion. The Struts framework will use 
> the value from the "key" attribute in the exception 
> element to automatically build ActionErrors for you. You 
> just need to use the  tag to display them.
> 
> To see where in the framework all of this takes place, 
> check out the source code for the ExceptionHandler class.
> 
> Hope this helps,
> 
> Chuck
> > Thanks Chuck,
> > 
> > Actually we are porting existing code and hence there are pre defined set
> of
> > Exception classes and we have decided not to add any more exception
> classes.
> > We are using error code to identify the exact problem.
> > 
> > >In your case, since you want all errors to go to the same 
> > >page, the path attribute would be "error.jsp" for all of 
> > >your exception elements. 
> > 
> > I agreed that I can define path variables for all the keys to "error.jsp",
> > like
> > 
> >  > key="name.not.found"
> > type="com.myexception.ServiceException"
> > path="/error.jsp"/>   
> > 
> >   > key="name.system.error"
> > type="com.myexception.SystemException"
> > path="/error.jsp"/>
> > 
> > 
> > 
> > But how do I fetch corresponding error message in my "error.jsp" file.
> Don't
> > I need to hardcode the "key" in the "error.jsp" like below. If not, please
> > point out how do I do it.
> > 
> > --
> > <%@ page language="java" %>
> > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> > 
> > 
> > 
> > 
> > Error Message is :-  
> > 
> > 
> > 
> > ---
> > 
> > Thanks,
> > Harvinder
> > 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 07, 2002 8:44 PM
> > To: Struts Users Mailing List
> > Subject: RE: Declarative Exception handling with Struts 1.1-b2
> > 
> > 
> > I may be misunderstanding your situation completely. If 
> > I have, I apologize ahead of time. Here's the short 
> > version of what I think.
> > 
> > Can you not throw more specific exceptions, ones that 
> > imply a little more about what went wrong? Then setup 
> > exception elements in the global section (or in the 
> > Action mappings if they are specific to the Action) and 
> > configure the application resource key for that specific 
> > exception.
> > 
> > I'm sure you understand this, but let me emphasize 
> > anyway, the point of declarative exception handling is 
> > that you shouldn't have to do anything programmatically 
> > to display errors. You specify what the error page is 
> > using the "path" attribute in the exception element. In 
> > your case, since you want all errors to go to the same 
> > page, the path attribute would be "error.jsp" for all of 
> > your exception elements. 
> > 
> > Does that make sense? Again, let me know if I 
> > misunderstood the question completely.
> > 
> > Chuck
> > > Chuck,
> > > 
> > > I have gone through this chapter but I didn't find anyway to re

Re: Using CheckLogin tag from within tiles

2002-10-07 Thread Eddie Bush

Oh - one more thing.  Filters really are a lot more flexible in that 
they can be deployed with the application.  I've heard of instances 
where hosting providers wouldn't configure realms for folks (nor would 
they do anything else that required a server config change) - and that 
is where a Filter would become an absolute necessity!

David Graham wrote:

> I've never used CMA because of potential implementation differences 
> across containers.  Are those fears justified?  I have used the Filter 
> approach and found it to be easy and portable.
>
> Dave 

-- 
Eddie Bush




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Security Chapter from O'Reilly Struts Book

2002-10-07 Thread chuckcavaness

As many of you know, I had to cut several chapters from 
the book due to time and size. Unfortunately, the 
chapter on security is one of those that got cut. I've 
received many email messages asking me if I was going to 
include it in the next edition or write it later. I've 
decided to write it and just make it freely available on 
the Struts site (assuming I can get one of the 
committers to post it). 

I'm going to put an outline together this week. If you 
would like to drop me any topics that you would 
especially like to see covered, I'll include them in the 
outline. I'll write the chapter, all you have to do is 
tell me what extra topics you want to see.

I'll post a draft outline within a week and get some 
feedback and then start writing it. As with the other 
comments and suggestions, please don't clog the Struts 
user list. Just send your comments and/or suggestions to 
[EMAIL PROTECTED] I'll respond accordingly.

chuck

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread Harvinder Singh

Chuck,

I have already tried that but I wonder if it works. In my case struts-config
looks like below.  

   
 

 

Now whenever java.myexception.GenericException is thrown, the message
corresponding to last entry is getting displayed, i.e., message corresponding
to "template.id.null" key. Please correct me if I am wrong.

-Harvinder

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 10:06 PM
To: Struts Users Mailing List
Subject: RE: Declarative Exception handling with Struts 1.1-b2


Ah, I see the confusion. The Struts framework will use 
the value from the "key" attribute in the exception 
element to automatically build ActionErrors for you. You 
just need to use the  tag to display them.

To see where in the framework all of this takes place, 
check out the source code for the ExceptionHandler class.

Hope this helps,

Chuck
> Thanks Chuck,
> 
> Actually we are porting existing code and hence there are pre defined set
of
> Exception classes and we have decided not to add any more exception
classes.
> We are using error code to identify the exact problem.
> 
> >In your case, since you want all errors to go to the same 
> >page, the path attribute would be "error.jsp" for all of 
> >your exception elements. 
> 
> I agreed that I can define path variables for all the keys to "error.jsp",
> like
> 
>  key="name.not.found"
> type="com.myexception.ServiceException"
> path="/error.jsp"/>   
> 
> key="name.system.error"
> type="com.myexception.SystemException"
> path="/error.jsp"/>
> 
> 
> 
> But how do I fetch corresponding error message in my "error.jsp" file.
Don't
> I need to hardcode the "key" in the "error.jsp" like below. If not, please
> point out how do I do it.
> 
> --
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> 
> 
> 
> 
> Error Message is :-  
> 
> 
> 
> ---
> 
> Thanks,
> Harvinder
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 8:44 PM
> To: Struts Users Mailing List
> Subject: RE: Declarative Exception handling with Struts 1.1-b2
> 
> 
> I may be misunderstanding your situation completely. If 
> I have, I apologize ahead of time. Here's the short 
> version of what I think.
> 
> Can you not throw more specific exceptions, ones that 
> imply a little more about what went wrong? Then setup 
> exception elements in the global section (or in the 
> Action mappings if they are specific to the Action) and 
> configure the application resource key for that specific 
> exception.
> 
> I'm sure you understand this, but let me emphasize 
> anyway, the point of declarative exception handling is 
> that you shouldn't have to do anything programmatically 
> to display errors. You specify what the error page is 
> using the "path" attribute in the exception element. In 
> your case, since you want all errors to go to the same 
> page, the path attribute would be "error.jsp" for all of 
> your exception elements. 
> 
> Does that make sense? Again, let me know if I 
> misunderstood the question completely.
> 
> Chuck
> > Chuck,
> > 
> > I have gone through this chapter but I didn't find anyway to retrieving
key
> > during run time for declarative exception handling. My requirement is to
> > maintain single error.jsp file, and hence the error key should not be
> > hardcoded. I am specifying a global exception, say, java.lang.Exception
and
> > for two different situation and I am throwing new Exception("key1"), and
> new
> > Exception(key2). I would love to get key (key1 or key2) in runtime and
> > replacing it will appropriate messages from
ApplicationResources.properties
> > file. Please point out if I missed sth in chapter 10 and there is a way
to
> > handle the situation I mentioned above.
> > 
> > Thanks,
> > Harvinder
> > 
> > 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 07, 2002 5:50 PM
> > To: Struts Users Mailing List
> > Subject: Re: Declarative Exception handling with Struts 1.1-b2
> > 
> > 
> > If you haven't already, may I suggest you download the 
> > draft of Chapter 10 from my book. It covers Struts and 
> > Exception Handling (both programmatic and declarative). 
> > 
> > Here's a link:
> > http://www.theserverside.com/resources/strutsreview.jsp
> > 
> > Sorry for the shameless plug, but I think the material 
> > will help.
> > 
> > Chuck
> > > Hi,
> > > Can anybody help me in understanding declarative exception handling
with
> > > Struts1.1b2? My requirement is maintaining only single "error.jsp"
file,
> > > which shou

Re: Using CheckLogin tag from within tiles

2002-10-07 Thread Eddie Bush

The only "implementation differences" would be in the way you configure 
it.  The use of it (from within your application) is governed by the 
spec, so there's not a lot of "wiggle room".  The configuration, 
however, is not governed by the spec ... so how it is setup will 
certainly vary from container to container :-(

I always use Tomcat, so it isn't an issue to me.  A buddy stuck on iAS 
3.5 was visiting with me about their approach and I suggested CMA to him 
(over implementing it in *every* servlet! ... no, they had no 
"utilitarian" functions they were calling - they were actually 
reimplementing it).  Turns out on iAS 3.5 there's a servlet you can 
configure for this.  In Tomcat, I just setup a JDBCRealm (there are 
other Realm implementations) and I'm done - piece of cake.

David Graham wrote:

> I've never used CMA because of potential implementation differences 
> across containers.  Are those fears justified?  I have used the Filter 
> approach and found it to be easy and portable.
>
> Dave 

-- 
Eddie Bush




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Cannot find bean error

2002-10-07 Thread Billy Ng

Make sure your clsoing tag is right.  I had the similar error message when I
had an incorrect closing  tag.

Hope this helps!

Billy Ng

- Original Message -
From: "Anoop" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 12:55 AM
Subject: RE: Cannot find bean error


> I checked these out, and seems correct. Are there anything specific issues
> which have to be looked into.
>
> Anoop.
>
> -Original Message-
> From: deepank [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 1:12 PM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: Re: Cannot find bean error
>
>
> Hi,
>  I am not sure about this, but i have had this problem. Make sure your
bean
> follows the specifications of a Bean.
> All properties have getter/setter methods. Sometimes Struts(or reflection
i
> should say)  will not recognize your class as bean because if this.
> Also double check if your storing it in some scope in your Action class.
>
> Deepank
>
>
> - Original Message -
> From: "Anoop" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 07, 2002 12:30 PM
> Subject: Cannot find bean error
>
>
> > Hi,
> >
> > I am trying to loop through an ArrayList returnd by a bean inside
> > 
> >
> > Name in the Iterator tag specifies a bean set in request scope in my
> > ActionBean, getter on which will return an ArrayList. I am trying to
read
> > the bean returned by the ArrayList inside the Iterator tag. There is an
> > exception thrown:
> >
> > javax.servlet.ServletException: Cannot find bean EMTTaskDetail in scope
> > null
> >
> > I tried specifying all the possible scopes, session and request but it
> still
> > throw this exception
> >
> > The scriptlet looks something like this:
> >
> >  > property="taskDetails">
> >
> >   
> >
> >  > property="taskName"/> ...
> >
> > getTaskDetails() on the bean set in the request scope with key
> > "timesheetDetails" returns an ArrayList of EMTTaskDetail objects.
> >
> > Thanks for your help.
> >
> > Thanks & Regards,
> > Anoop.
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Using CheckLogin tag from within tiles

2002-10-07 Thread David Graham

I've never used CMA because of potential implementation differences across 
containers.  Are those fears justified?  I have used the Filter approach and 
found it to be easy and portable.

Dave


>From: Eddie Bush <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: Struts Users Mailing List <[EMAIL PROTECTED]>
>Subject: Re: Using CheckLogin tag from within tiles
>Date: Mon, 07 Oct 2002 11:59:34 -0500
>
>... or use container-managed authentication (CMA) :-) and place the burden 
>on the server itself.  Sorry - had to chip in!  I honestly don't know how 
>long CMA has been a part of the servlet specification - but I'd wager that 
>wouldn't be spec 2.3 dependent ;-)
>
>David Graham wrote:
>
>>Another of those best practices is to use a Filter to authenticate the 
>>user before they ever reach your application.  This requires a servlet 2.3 
>>compliant container and doesn't easily allow you to use struts specific 
>>classes.
>>
>>So, if you don't need struts to authenticate and are using a 2.3 
>>container, use the Filter approach.
>>
>>Dave
>>
>>>From: "James Mitchell" <[EMAIL PROTECTED]>
>>>Subject: Re: Using CheckLogin tag from within tiles
>>>Date: Mon, 7 Oct 2002 12:43:41 -0400
>>>
>>>There have been many "best practices" published (media) and posted (users
>>>list) over the last year or so that, if followed, can/would elimiate 
>>>these
>>>kinds of issues.
>>>
>>>By forcing all interactions with your webapp to go through your custom
>>>actions, you can keep your "check for session expire" code in your action
>>>classes and not have to rely on your jsp to enforce it.
>>>
>>>I typically do this in an abstract BaseAction which all actions (except
>>>those not requiring authentication or session data) are required to 
>>>extend.
>>>
>>> > - If I put it in the body insert, then when the login check fails
>>> >   (because of session timeout) it throws an exception saying that it
>>> >   couldn't forward because the output was already committed (I presume
>>> >   that the preceding tiles do a flush).
>>>
>>>By placing my "is session expired" code in the base action, I do not have 
>>>to
>>>replicate the check anywhere else, which elimiates this issue.
>>>
>>> > - If I put it at the top of the simpleLayout.jsp (which I thought 
>>>would
>>> >   be before anything was flushed) then it detects the error (and 
>>>creates
>>> >   the correct ActionError) but the forward to the logon page doesn't
>>> >   work (the current page is displayed) and the page skip of the
>>> >   CheckLogin tag doesn't work.
>>>
>>>Not sure why this is happening, but see above for avoiding it as well.
>>>
>>>Hope that helps.
>>>James Mitchell
>>
>
>--
>Eddie Bush
>
>
>
>
>--
>To unsubscribe, e-mail:   
>
>For additional commands, e-mail: 
>




_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Using CheckLogin tag from within tiles

2002-10-07 Thread Eddie Bush

... or use container-managed authentication (CMA) :-) and place the 
burden on the server itself.  Sorry - had to chip in!  I honestly don't 
know how long CMA has been a part of the servlet specification - but I'd 
wager that wouldn't be spec 2.3 dependent ;-)

David Graham wrote:

> Another of those best practices is to use a Filter to authenticate the 
> user before they ever reach your application.  This requires a servlet 
> 2.3 compliant container and doesn't easily allow you to use struts 
> specific classes.
>
> So, if you don't need struts to authenticate and are using a 2.3 
> container, use the Filter approach.
>
> Dave
>
>> From: "James Mitchell" <[EMAIL PROTECTED]>
>> Subject: Re: Using CheckLogin tag from within tiles
>> Date: Mon, 7 Oct 2002 12:43:41 -0400
>>
>> There have been many "best practices" published (media) and posted 
>> (users
>> list) over the last year or so that, if followed, can/would elimiate 
>> these
>> kinds of issues.
>>
>> By forcing all interactions with your webapp to go through your custom
>> actions, you can keep your "check for session expire" code in your 
>> action
>> classes and not have to rely on your jsp to enforce it.
>>
>> I typically do this in an abstract BaseAction which all actions (except
>> those not requiring authentication or session data) are required to 
>> extend.
>>
>> > - If I put it in the body insert, then when the login check fails
>> >   (because of session timeout) it throws an exception saying that it
>> >   couldn't forward because the output was already committed (I presume
>> >   that the preceding tiles do a flush).
>>
>> By placing my "is session expired" code in the base action, I do not 
>> have to
>> replicate the check anywhere else, which elimiates this issue.
>>
>> > - If I put it at the top of the simpleLayout.jsp (which I thought 
>> would
>> >   be before anything was flushed) then it detects the error (and 
>> creates
>> >   the correct ActionError) but the forward to the logon page doesn't
>> >   work (the current page is displayed) and the page skip of the
>> >   CheckLogin tag doesn't work.
>>
>> Not sure why this is happening, but see above for avoiding it as well.
>>
>> Hope that helps.
>> James Mitchell 
>

-- 
Eddie Bush




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Using CheckLogin tag from within tiles

2002-10-07 Thread David Graham

Another of those best practices is to use a Filter to authenticate the user 
before they ever reach your application.  This requires a servlet 2.3 
compliant container and doesn't easily allow you to use struts specific 
classes.

So, if you don't need struts to authenticate and are using a 2.3 container, 
use the Filter approach.

Dave


>From: "James Mitchell" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: Re: Using CheckLogin tag from within tiles
>Date: Mon, 7 Oct 2002 12:43:41 -0400
>
>There have been many "best practices" published (media) and posted (users
>list) over the last year or so that, if followed, can/would elimiate these
>kinds of issues.
>
>By forcing all interactions with your webapp to go through your custom
>actions, you can keep your "check for session expire" code in your action
>classes and not have to rely on your jsp to enforce it.
>
>I typically do this in an abstract BaseAction which all actions (except
>those not requiring authentication or session data) are required to extend.
>
> > - If I put it in the body insert, then when the login check fails
> >   (because of session timeout) it throws an exception saying that it
> >   couldn't forward because the output was already committed (I presume
> >   that the preceding tiles do a flush).
>
>By placing my "is session expired" code in the base action, I do not have 
>to
>replicate the check anywhere else, which elimiates this issue.
>
>
> > - If I put it at the top of the simpleLayout.jsp (which I thought would
> >   be before anything was flushed) then it detects the error (and creates
> >   the correct ActionError) but the forward to the logon page doesn't
> >   work (the current page is displayed) and the page skip of the
> >   CheckLogin tag doesn't work.
>
>Not sure why this is happening, but see above for avoiding it as well.
>
>Hope that helps.
>James Mitchell
>
>
>- Original Message -
>From: "Alan P Sexton" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, October 06, 2002 1:26 PM
>Subject: Using CheckLogin tag from within tiles
>
>
> >
> > I am switching from plain JSP to using tiles. I was using a CheckLogin
> > tag on my JSP based on the one in the example for struts. This checks if
> > there is a valid user in the session and, if not, creates an ActionError
> > indicating that the session has timed out and forwards to logon.
> >
> > Now I have a simpleLayout.jsp similar to that in the tiles section of
> > the Chuck Cavaness's online book draft: I insert a header, a body and a
> > footer in the simpleLayout for my normal pages.
> >
> > Now I have a problem with the CheckLogin tag:
> >
> > - If I put it in the body insert, then when the login check fails
> >   (because of session timeout) it throws an exception saying that it
> >   couldn't forward because the output was already committed (I presume
> >   that the preceding tiles do a flush).
> >
> > - If I put it at the top of the simpleLayout.jsp (which I thought would
> >   be before anything was flushed) then it detects the error (and creates
> >   the correct ActionError) but the forward to the logon page doesn't
> >   work (the current page is displayed) and the page skip of the
> >   CheckLogin tag doesn't work.
> >
> > Can anyone explain to me what is going on and how to fix it?
> >
> >
> > Alan Sexton
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
>
> > For additional commands, e-mail:
>
> >
> >
>
>
>--
>To unsubscribe, e-mail:   
>
>For additional commands, e-mail: 
>




_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: How to change struts log level in Tomcat 4.1.x?

2002-10-07 Thread Eddie Bush

Keith :-) Please don't continuously repost the same exact question. It
doesn't benefit anyone. If you don't get a reply, it's probably because
the post hasn't come across the eyes of someone that knows - or someone
that is confident enough about their knowledge to share it. Reposting is
a really good way to get your posts totally ignored :-) and I don't
think you want that (I personally find it very annoying - we get enough
traffic as it is).

Have you seen my reply to this question? Did it help? Have you tried
anything yet? Many Jakarta projects are using commons-logging nowadays -
you might breeze by commons and check for information on
commons-logging. Log4J is a popular logger - conveniently you can also
find information about it on the Jakarta site. If you're under JDK1.4
I'd recommend searching Sun's site for help configuring JDK the 1.4 logger.

Remember: This is a volunteer effort, and many of us have other, more
pressing, things we have to do than just sit here and respond to your
inquiries as quickly as we can.

Keith Cheng wrote:

>Hi all,
>
>As far as I know, the default log level of struts is INFO, how can I 
>change it to other level such as DEBUG? I am using struts 1.1b2 with 
>Tomcat 4.1.10.
>
>Thanks!
>
>Regards,
>
>-- Keith Cheng
>
-- 
Eddie Bush




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Using CheckLogin tag from within tiles

2002-10-07 Thread James Mitchell

There have been many "best practices" published (media) and posted (users
list) over the last year or so that, if followed, can/would elimiate these
kinds of issues.

By forcing all interactions with your webapp to go through your custom
actions, you can keep your "check for session expire" code in your action
classes and not have to rely on your jsp to enforce it.

I typically do this in an abstract BaseAction which all actions (except
those not requiring authentication or session data) are required to extend.

> - If I put it in the body insert, then when the login check fails
>   (because of session timeout) it throws an exception saying that it
>   couldn't forward because the output was already committed (I presume
>   that the preceding tiles do a flush).

By placing my "is session expired" code in the base action, I do not have to
replicate the check anywhere else, which elimiates this issue.


> - If I put it at the top of the simpleLayout.jsp (which I thought would
>   be before anything was flushed) then it detects the error (and creates
>   the correct ActionError) but the forward to the logon page doesn't
>   work (the current page is displayed) and the page skip of the
>   CheckLogin tag doesn't work.

Not sure why this is happening, but see above for avoiding it as well.

Hope that helps.
James Mitchell


- Original Message -
From: "Alan P Sexton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, October 06, 2002 1:26 PM
Subject: Using CheckLogin tag from within tiles


>
> I am switching from plain JSP to using tiles. I was using a CheckLogin
> tag on my JSP based on the one in the example for struts. This checks if
> there is a valid user in the session and, if not, creates an ActionError
> indicating that the session has timed out and forwards to logon.
>
> Now I have a simpleLayout.jsp similar to that in the tiles section of
> the Chuck Cavaness's online book draft: I insert a header, a body and a
> footer in the simpleLayout for my normal pages.
>
> Now I have a problem with the CheckLogin tag:
>
> - If I put it in the body insert, then when the login check fails
>   (because of session timeout) it throws an exception saying that it
>   couldn't forward because the output was already committed (I presume
>   that the preceding tiles do a flush).
>
> - If I put it at the top of the simpleLayout.jsp (which I thought would
>   be before anything was flushed) then it detects the error (and creates
>   the correct ActionError) but the forward to the logon page doesn't
>   work (the current page is displayed) and the page skip of the
>   CheckLogin tag doesn't work.
>
> Can anyone explain to me what is going on and how to fix it?
>
>
> Alan Sexton
>
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread chuckcavaness

Ah, I see the confusion. The Struts framework will use 
the value from the "key" attribute in the exception 
element to automatically build ActionErrors for you. You 
just need to use the  tag to display them.

To see where in the framework all of this takes place, 
check out the source code for the ExceptionHandler class.

Hope this helps,

Chuck
> Thanks Chuck,
> 
> Actually we are porting existing code and hence there are pre defined set of
> Exception classes and we have decided not to add any more exception classes.
> We are using error code to identify the exact problem.
> 
> >In your case, since you want all errors to go to the same 
> >page, the path attribute would be "error.jsp" for all of 
> >your exception elements. 
> 
> I agreed that I can define path variables for all the keys to "error.jsp",
> like
> 
>  key="name.not.found"
> type="com.myexception.ServiceException"
> path="/error.jsp"/>   
> 
> key="name.system.error"
> type="com.myexception.SystemException"
> path="/error.jsp"/>
> 
> 
> 
> But how do I fetch corresponding error message in my "error.jsp" file. Don't
> I need to hardcode the "key" in the "error.jsp" like below. If not, please
> point out how do I do it.
> 
> --
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> 
> 
> 
> 
> Error Message is :-  
> 
> 
> 
> ---
> 
> Thanks,
> Harvinder
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 8:44 PM
> To: Struts Users Mailing List
> Subject: RE: Declarative Exception handling with Struts 1.1-b2
> 
> 
> I may be misunderstanding your situation completely. If 
> I have, I apologize ahead of time. Here's the short 
> version of what I think.
> 
> Can you not throw more specific exceptions, ones that 
> imply a little more about what went wrong? Then setup 
> exception elements in the global section (or in the 
> Action mappings if they are specific to the Action) and 
> configure the application resource key for that specific 
> exception.
> 
> I'm sure you understand this, but let me emphasize 
> anyway, the point of declarative exception handling is 
> that you shouldn't have to do anything programmatically 
> to display errors. You specify what the error page is 
> using the "path" attribute in the exception element. In 
> your case, since you want all errors to go to the same 
> page, the path attribute would be "error.jsp" for all of 
> your exception elements. 
> 
> Does that make sense? Again, let me know if I 
> misunderstood the question completely.
> 
> Chuck
> > Chuck,
> > 
> > I have gone through this chapter but I didn't find anyway to retrieving key
> > during run time for declarative exception handling. My requirement is to
> > maintain single error.jsp file, and hence the error key should not be
> > hardcoded. I am specifying a global exception, say, java.lang.Exception and
> > for two different situation and I am throwing new Exception("key1"), and
> new
> > Exception(key2). I would love to get key (key1 or key2) in runtime and
> > replacing it will appropriate messages from ApplicationResources.properties
> > file. Please point out if I missed sth in chapter 10 and there is a way to
> > handle the situation I mentioned above.
> > 
> > Thanks,
> > Harvinder
> > 
> > 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 07, 2002 5:50 PM
> > To: Struts Users Mailing List
> > Subject: Re: Declarative Exception handling with Struts 1.1-b2
> > 
> > 
> > If you haven't already, may I suggest you download the 
> > draft of Chapter 10 from my book. It covers Struts and 
> > Exception Handling (both programmatic and declarative). 
> > 
> > Here's a link:
> > http://www.theserverside.com/resources/strutsreview.jsp
> > 
> > Sorry for the shameless plug, but I think the material 
> > will help.
> > 
> > Chuck
> > > Hi,
> > > Can anybody help me in understanding declarative exception handling with
> > > Struts1.1b2? My requirement is maintaining only single "error.jsp" file,
> > > which should be displayed when an exception is thrown. We are having
> > multiple
> > > exception classes and when an exception is thrown an error id is
> associated
> > > with it to get appropriate message. If I put all the error code vs error
> > > messages in ApplicationResources.properties, there should be a way to
> fetch
> > > the error code from the thrown exception, and then displaying the
> > appropriate
> > > message. Any help is appriciated.
> > > Thanks,
> > > Harvinder
> > > 
> > > --
> > > To unsubscribe, e-mail:
> > 
> > > For additional commands, e-mail:
> > 

Re: connection pools

2002-10-07 Thread Adolfo Miguelez


cheers everybody,

Adolfo.

>From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: Struts Users Mailing List <[EMAIL PROTECTED]>, Dariusz 
>Wojtas <[EMAIL PROTECTED]>
>Subject: Re: connection pools
>Date: Mon, 7 Oct 2002 09:16:14 -0700 (PDT)
>
>
>
>On Mon, 7 Oct 2002, Dariusz Wojtas wrote:
>
> > Date: Mon, 7 Oct 2002 16:21:54 +0200
> > From: Dariusz Wojtas <[EMAIL PROTECTED]>
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
> >  Dariusz Wojtas <[EMAIL PROTECTED]>
> > To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > Subject: Re: connection pools
> >
> > Monday, October 7, 2002, 4:14:32 PM, you wrote:
> > AM> Hi All,
> >
> > AM> a quick question. I just need references to open source database 
>connection
> > AM> pools available for checking out. I know Poolman and Protomatter.
> >
> > AM> Does Apache provides any more complete pool? Any nicer pool 
>anywhere?
> >
> > Try commons-dbcp from Jakarta.
> > http://jakarta.apache.org/commons/dbcp.html
> >
> > It is integrated with several products (tomcat, hibernate)
> > and works nicely.
> >
>
>Struts 1.1 also incorporates the DBCP connection pool under the covers.
>
> > Darek
>
>Craig
>
>
>--
>To unsubscribe, e-mail:   
>
>For additional commands, e-mail: 
>





  
 Adolfo's signature
  
  
 Adolfo Rodriguez Miguelez

  
  





_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: connection pools

2002-10-07 Thread Craig R. McClanahan



On Mon, 7 Oct 2002, Dariusz Wojtas wrote:

> Date: Mon, 7 Oct 2002 16:21:54 +0200
> From: Dariusz Wojtas <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
>  Dariusz Wojtas <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: connection pools
>
> Monday, October 7, 2002, 4:14:32 PM, you wrote:
> AM> Hi All,
>
> AM> a quick question. I just need references to open source database connection
> AM> pools available for checking out. I know Poolman and Protomatter.
>
> AM> Does Apache provides any more complete pool? Any nicer pool anywhere?
>
> Try commons-dbcp from Jakarta.
> http://jakarta.apache.org/commons/dbcp.html
>
> It is integrated with several products (tomcat, hibernate)
> and works nicely.
>

Struts 1.1 also incorporates the DBCP connection pool under the covers.

> Darek

Craig


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




How to change struts log level in Tomcat 4.1.x?

2002-10-07 Thread Keith Cheng

Hi all,

As far as I know, the default log level of struts is INFO, how can I 
change it to other level such as DEBUG? I am using struts 1.1b2 with 
Tomcat 4.1.10.

Thanks!

Regards,

-- Keith Cheng

¤^¤¢¤ý¤l¡A²Ó¸ô¡A¦n¤ß¤À¤â¡AÛûÛû¨B«¢©i¤Ó­¦...
¶V800­º¦Ü·s¦ÜHit¤â¾÷¹aÁn!
Over 800 latest ringtones, only on Yahoo!



Re: How to change struts log level when using it with Tomcat 4.1. x?

2002-10-07 Thread Eddie Bush

 guess again ;-) Nowadays, since commons logging is used, that
setting in web.xml is for backward compatability - and I don't think it
does *anything*.

I gather you're trying to get some more detail? Seems to me you may be
able to create "commons-logging.properties" in your top-level classes
directory, and specify something like:
org.apache.struts=DEBUG

I haven't attempted to configure just commons logging though. If you're
either using Log4J or you're under JDK1.4 (and using the JDK 1.4
logger), you can mention the package (you can get as fine-grained as to
specify a given class) in a different logging config file
(log4j.properties for log4j and ... you probably don't want to use the
default one under JDK1.4 - hit Sun's site to see how to use a different
file).

Of course, you could always take the "easy" way out and just hack the
source ;-) (if you think learning to configure logging is too big a
pain!) but I'd figure out how to control it with your logging properties
- it's a lot fast/easier/dependable ;-)

Divakar Satyanarayan wrote:

>Look at the configuration you can do in web.xml file I think u can set the
>debug level there 
>
>Regards,
>Divakar
>
>>-Original Message-
>>From: Keith Cheng [SMTP:[EMAIL PROTECTED]]
>>Sent: Monday, October 07, 2002 7:52 PM
>>To:   [EMAIL PROTECTED]
>>Subject:  How to change struts log level when using it with Tomcat
>>4.1.x?
>>
>>Hi all,
>>
>>As far as I know, the default log level of struts is INFO, how can I 
>>change it to other level such as DEBUG? I am using struts 1.1b2 with 
>>Tomcat 4.1.10.
>>
>>Thanks!
>>
>>Regards,
>>
>>-- Keith Cheng
>>

-- 
Eddie Bush




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread Harvinder Singh

Thanks Chuck,

Actually we are porting existing code and hence there are pre defined set of
Exception classes and we have decided not to add any more exception classes.
We are using error code to identify the exact problem.

>In your case, since you want all errors to go to the same 
>page, the path attribute would be "error.jsp" for all of 
>your exception elements. 

I agreed that I can define path variables for all the keys to "error.jsp",
like

   

 



But how do I fetch corresponding error message in my "error.jsp" file. Don't
I need to hardcode the "key" in the "error.jsp" like below. If not, please
point out how do I do it.

--
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>




Error Message is :-  



---

Thanks,
Harvinder

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 8:44 PM
To: Struts Users Mailing List
Subject: RE: Declarative Exception handling with Struts 1.1-b2


I may be misunderstanding your situation completely. If 
I have, I apologize ahead of time. Here's the short 
version of what I think.

Can you not throw more specific exceptions, ones that 
imply a little more about what went wrong? Then setup 
exception elements in the global section (or in the 
Action mappings if they are specific to the Action) and 
configure the application resource key for that specific 
exception.

I'm sure you understand this, but let me emphasize 
anyway, the point of declarative exception handling is 
that you shouldn't have to do anything programmatically 
to display errors. You specify what the error page is 
using the "path" attribute in the exception element. In 
your case, since you want all errors to go to the same 
page, the path attribute would be "error.jsp" for all of 
your exception elements. 

Does that make sense? Again, let me know if I 
misunderstood the question completely.

Chuck
> Chuck,
> 
> I have gone through this chapter but I didn't find anyway to retrieving key
> during run time for declarative exception handling. My requirement is to
> maintain single error.jsp file, and hence the error key should not be
> hardcoded. I am specifying a global exception, say, java.lang.Exception and
> for two different situation and I am throwing new Exception("key1"), and
new
> Exception(key2). I would love to get key (key1 or key2) in runtime and
> replacing it will appropriate messages from ApplicationResources.properties
> file. Please point out if I missed sth in chapter 10 and there is a way to
> handle the situation I mentioned above.
> 
> Thanks,
> Harvinder
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 5:50 PM
> To: Struts Users Mailing List
> Subject: Re: Declarative Exception handling with Struts 1.1-b2
> 
> 
> If you haven't already, may I suggest you download the 
> draft of Chapter 10 from my book. It covers Struts and 
> Exception Handling (both programmatic and declarative). 
> 
> Here's a link:
> http://www.theserverside.com/resources/strutsreview.jsp
> 
> Sorry for the shameless plug, but I think the material 
> will help.
> 
> Chuck
> > Hi,
> > Can anybody help me in understanding declarative exception handling with
> > Struts1.1b2? My requirement is maintaining only single "error.jsp" file,
> > which should be displayed when an exception is thrown. We are having
> multiple
> > exception classes and when an exception is thrown an error id is
associated
> > with it to get appropriate message. If I put all the error code vs error
> > messages in ApplicationResources.properties, there should be a way to
fetch
> > the error code from the thrown exception, and then displaying the
> appropriate
> > message. Any help is appriciated.
> > Thanks,
> > Harvinder
> > 
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> > 
> 
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

> 
> 
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: NullPointerException in TabsLayout??

2002-10-07 Thread Cedric Dumoulin


  Hi all,

  I have found what is wrong: tomcat 4.1.12 do reuse of the tag 
, and one property of the tag was not used properly. I 
have now corrected the implementation class of the tag 
(UseAttributeTag.java): the tiles tabs example now works with Tomcat 
4.1.12. The modification will be available in next nightly build.

  Cedric

Curtney Jacobs wrote:

>Greetings!!
>
>I am having problems viewing the tiles-documentation example, specifically the 
>tab examples. Everything else works fine except the tabs.
>
>There was a similar question posted to the group on July 17, 2002, 
>titled "Struts Tabs Example Error" by Peggy Davidson. However, the problem was 
>not resolved or no one posted a fix to the problem. If anyone has encountered 
>a similar problem and found a solution, please advise me.
>
>I am running tomcat  version 4.1.12.
>I am using jakarta-struts-1.1-b2
>
>Below is the error message I am receiving.
> 
>(Sorry Cedric, I should have posted the error message earlier)
>
>All help is greatly appreciated.
>
>_CJ
>
>
>- Root Cause -
>java.lang.NullPointerException
>   at org.apache.jsp.tabsLayout_jsp._jspService(tabsLayout_jsp.java:121)
>   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at 
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
>   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at 
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
>   at 
>org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:575)
>   at 
>org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498)
>   at 
>org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:820)
>   at 
>org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:395)
>   at 
>org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:865)
>   at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:487)
>   at 
>org.apache.jsp.classicLayout_jsp._jspx_meth_tiles_insert_2(classicLayout_jsp.java:160)
>   at org.apache.jsp.classicLayout_jsp._jspService(classicLayout_jsp.java:81)
>   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at 
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
>   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at 
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
>   at 
>org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:575)
>   at 
>org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498)
>   at 
>org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:820)
>   at 
>org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:395)
>   at 
>org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:865)
>   at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:487)
>   at org.apache.jsp.tabs_jsp._jspx_meth_tiles_insert_0(tabs_jsp.java:76)
>   at org.apache.jsp.tabs_jsp._jspService(tabs_jsp.java:53)
>   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:136)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at 
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
>   at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at 
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
>   at 
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
>   at 
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
>   at 
>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>   at 
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>   at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>   at 
>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>   at 
>org.apache.catalina.core.Standar

RE: Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread chuckcavaness

I may be misunderstanding your situation completely. If 
I have, I apologize ahead of time. Here's the short 
version of what I think.

Can you not throw more specific exceptions, ones that 
imply a little more about what went wrong? Then setup 
exception elements in the global section (or in the 
Action mappings if they are specific to the Action) and 
configure the application resource key for that specific 
exception.

I'm sure you understand this, but let me emphasize 
anyway, the point of declarative exception handling is 
that you shouldn't have to do anything programmatically 
to display errors. You specify what the error page is 
using the "path" attribute in the exception element. In 
your case, since you want all errors to go to the same 
page, the path attribute would be "error.jsp" for all of 
your exception elements. 

Does that make sense? Again, let me know if I 
misunderstood the question completely.

Chuck
> Chuck,
> 
> I have gone through this chapter but I didn't find anyway to retrieving key
> during run time for declarative exception handling. My requirement is to
> maintain single error.jsp file, and hence the error key should not be
> hardcoded. I am specifying a global exception, say, java.lang.Exception and
> for two different situation and I am throwing new Exception("key1"), and new
> Exception(key2). I would love to get key (key1 or key2) in runtime and
> replacing it will appropriate messages from ApplicationResources.properties
> file. Please point out if I missed sth in chapter 10 and there is a way to
> handle the situation I mentioned above.
> 
> Thanks,
> Harvinder
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 5:50 PM
> To: Struts Users Mailing List
> Subject: Re: Declarative Exception handling with Struts 1.1-b2
> 
> 
> If you haven't already, may I suggest you download the 
> draft of Chapter 10 from my book. It covers Struts and 
> Exception Handling (both programmatic and declarative). 
> 
> Here's a link:
> http://www.theserverside.com/resources/strutsreview.jsp
> 
> Sorry for the shameless plug, but I think the material 
> will help.
> 
> Chuck
> > Hi,
> > Can anybody help me in understanding declarative exception handling with
> > Struts1.1b2? My requirement is maintaining only single "error.jsp" file,
> > which should be displayed when an exception is thrown. We are having
> multiple
> > exception classes and when an exception is thrown an error id is associated
> > with it to get appropriate message. If I put all the error code vs error
> > messages in ApplicationResources.properties, there should be a way to fetch
> > the error code from the thrown exception, and then displaying the
> appropriate
> > message. Any help is appriciated.
> > Thanks,
> > Harvinder
> > 
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> > 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to change struts log level when using it with Tomcat 4.1.x?

2002-10-07 Thread Divakar Satyanarayan

Look at the configuration you can do in web.xml file I think u can set the
debug level there 

Regards,
Divakar

> -Original Message-
> From: Keith Cheng [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 7:52 PM
> To:   [EMAIL PROTECTED]
> Subject:  How to change struts log level when using it with Tomcat
> 4.1.x?
> 
> Hi all,
> 
> As far as I know, the default log level of struts is INFO, how can I 
> change it to other level such as DEBUG? I am using struts 1.1b2 with 
> Tomcat 4.1.10.
> 
> Thanks!
> 
> Regards,
> 
> -- Keith Cheng
> 
> ¤^¤¢¤ý¤l¡A²Ó¸ô¡A¦n¤ß¤À¤â¡AÛûÛû¨B«¢©i¤Ó­¦...
> ¶V800­º¦Ü·s¦ÜHit¤â¾÷¹aÁn!
> Over 800 latest ringtones, only on Yahoo!
> 
> 
DISCLAIMER: Information contained and transmitted by this E-MAIL is
proprietary to Mascot Systems Limited and is intended for use only by the
individual or entity to which it is addressed, and may contain information
that is privileged, confidential or exempt from disclosure under applicable
law. If this is a forwarded message, the content of this E-MAIL may not have
been sent with the authority of the Company. If you are not the intended
recipient, an agent of the intended recipient or a person responsible for
delivering the information to the named recipient, you are notified that any
use, distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at [EMAIL PROTECTED] Before opening attachments,
please scan for viruses. 



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




How to change struts log level when using it with Tomcat 4.1.x?

2002-10-07 Thread Keith Cheng

Hi all,

As far as I know, the default log level of struts is INFO, how can I 
change it to other level such as DEBUG? I am using struts 1.1b2 with 
Tomcat 4.1.10.

Thanks!

Regards,

-- Keith Cheng

¤^¤¢¤ý¤l¡A²Ó¸ô¡A¦n¤ß¤À¤â¡AÛûÛû¨B«¢©i¤Ó­¦...
¶V800­º¦Ü·s¦ÜHit¤â¾÷¹aÁn!
Over 800 latest ringtones, only on Yahoo!



RE: connection pools

2002-10-07 Thread Hajratwala, Nayan (N.)

adolfo,

take a look at commons-dbcp for database pooling 

http://jakarta.apache.org/commons/dbcp.html

and commons-pool for generic pooling

http://jakarta.apache.org/commons/pool.html

Good luck!  You can direct any questions you have about using it to the commons-user 
mailing list.


---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


-Original Message-
From: Adolfo Miguelez [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 10:15 AM
To: [EMAIL PROTECTED]
Subject: connection pools


Hi All,

a quick question. I just need references to open source database connection 
pools available for checking out. I know Poolman and Protomatter.

Does Apache provides any more complete pool? Any nicer pool anywhere?

TIA,

Adolfo.





_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: connection pools

2002-10-07 Thread Dariusz Wojtas

Monday, October 7, 2002, 4:14:32 PM, you wrote:
AM> Hi All,

AM> a quick question. I just need references to open source database connection 
AM> pools available for checking out. I know Poolman and Protomatter.

AM> Does Apache provides any more complete pool? Any nicer pool anywhere?

Try commons-dbcp from Jakarta.
http://jakarta.apache.org/commons/dbcp.html

It is integrated with several products (tomcat, hibernate)
and works nicely.

Darek


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




How to change struts log level?

2002-10-07 Thread Keith Cheng


Hi all,

As far as I know, the default log level of struts is INFO, how can I change it to 
other level such as DEBUG? I am using struts 1.1b2 with Tomcat 4.1.10.

Thanks!

Regards,

-- Keith Cheng

 

¤^¤¢¤ý¤l¡A²Ó¸ô¡A¦n¤ß¤À¤â¡AÛûÛû¨B«¢©i¤Ó­¦...
¶V800­º¦Ü·s¦ÜHit¤â¾÷¹aÁn!
Over 800 latest ringtones, only on Yahoo!



connection pools

2002-10-07 Thread Adolfo Miguelez

Hi All,

a quick question. I just need references to open source database connection 
pools available for checking out. I know Poolman and Protomatter.

Does Apache provides any more complete pool? Any nicer pool anywhere?

TIA,

Adolfo.





_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread Harvinder Singh

Chuck,

I have gone through this chapter but I didn't find anyway to retrieving key
during run time for declarative exception handling. My requirement is to
maintain single error.jsp file, and hence the error key should not be
hardcoded. I am specifying a global exception, say, java.lang.Exception and
for two different situation and I am throwing new Exception("key1"), and new
Exception(key2). I would love to get key (key1 or key2) in runtime and
replacing it will appropriate messages from ApplicationResources.properties
file. Please point out if I missed sth in chapter 10 and there is a way to
handle the situation I mentioned above.

Thanks,
Harvinder


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:50 PM
To: Struts Users Mailing List
Subject: Re: Declarative Exception handling with Struts 1.1-b2


If you haven't already, may I suggest you download the 
draft of Chapter 10 from my book. It covers Struts and 
Exception Handling (both programmatic and declarative). 

Here's a link:
http://www.theserverside.com/resources/strutsreview.jsp

Sorry for the shameless plug, but I think the material 
will help.

Chuck
> Hi,
> Can anybody help me in understanding declarative exception handling with
> Struts1.1b2? My requirement is maintaining only single "error.jsp" file,
> which should be displayed when an exception is thrown. We are having
multiple
> exception classes and when an exception is thrown an error id is associated
> with it to get appropriate message. If I put all the error code vs error
> messages in ApplicationResources.properties, there should be a way to fetch
> the error code from the thrown exception, and then displaying the
appropriate
> message. Any help is appriciated.
> Thanks,
> Harvinder
> 
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Hi Luca,

Great suggestion! Also, I agree with you about not using frame, but we have a business 
requirement that requires us to use a frame, ie: the user does not want to see the 
table headings (and some other data) disappear in a page when they scroll down the 
list of records.

Thanks,
Tuan

-Original Message-
From: Luca Zago [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 6:55 AM
To: Struts Users Mailing List
Subject: Re: Passing a request parameter within Struts framework


Hi,
your problem is clear, and it has very few solutions :)
The problem is that you use frames. Every Frame in a different request,
then the request from your form..end at the page containing the 
frameset, and your request with your parameters set in your form ends 
here. All the pages inside the frames are different GET requests from 
the browser, then they cannot have access your parameters and 
attributess (belonging to you former request).
Solutions:
if your parameter is only a string you can build a string chain..in the 
src of your frame tag:
" 
name="top" id="top" frameborder="0" scrolling="no" noresize 
marginwidth="0" marginheight="0" framespacing="0">
In this case your new request wll have the parameter named myparameterName.
It's very unelegant solution but it could work
Second put your object in the user's session. it's resonable to put it 
in session after all, if I understand well, is an attribute of a user's 
profile.

A general suggestions, don't user frames in dynamic pages, you can have 
always problems with them, Jsp has a nice templating machanism, use that 
to build your header or footer.


Tuan H. Le wrote:
> Hi,
> 
> How do I pass a request attribute to another form? In my case, after a successful 
>login, it would forward the user to 
> the main form (MainMeu.jsp which has a frameset). In the main form, it has several 
>tabs. By default, it displays the
> first tab.
> 
> Currently, in the perform() method of LoginAction class, I have the following code
> 
> //...
> request.setAttribute( "selTopNav", "1" );
> return( mapping.findForward( target ) );
> 
> 
> Here's the code for the MainMenu.jsp
> 
> 
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> 
> 
> 
> 
> 
> 
> 
> marginwidth="0" marginheight="0" framespacing="0">
> 
> scrolling="yes" frameborder="0" noresize framespacing="0">
> marginheight="10" scrolling="no" frameborder="0" noresize framespacing="0">
> 
> marginwidth="0" marginheight="0" noresize framespacing="0">
> 
> 
> 
> 
> 
> 
> 
> And, in the Top.jsp, I have a test code to get a value of the request attribute, but 
>it always returns a null value
> 
> Top Nav: <%= request.getParameter( "selTopNav" ) %>
> 
> Here's a partial of my struts-config.xml file
> 
>   
> 
> type="com.phs.ezhr.presentation.form.MainMenuForm" />
>   
> 
>   
> 
>   
> 
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
> 
> 
> Do you know what I'm missing?
> 
> Thanks,
> Tuan
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

-- 
Luca Zago
Senior IT Developer
_

E-TREE S.p.a.  Via Fonderia 43 - 31100 Treviso (Italy)
phone +39.0422.3107
fax   +39.0422.310888
http://www.e-tree.com  http://www.webanana.com
_


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Passing a request parameter within Struts framework

2002-10-07 Thread Thomas Eichberger

Hmmm, try to read out all request parameters, request attributes, and 
session attributes in the start of the page.

Something like

for ( Enumeration enum = request.getAttributeNames(); enum.hasMoreElements(); )
{
 Object key = enum.nextElement();
 Object value = request.getAttribute( key );
 System.out.println( key + " --> " + value );
}

to find out more...


Put that code in a utility method (maybe there is one in the struts library???)

Thomas



At 06:40 07.10.2002 -0700, Tuan H. Le wrote:
>Hi,
>
>I tried request.getAttribute( "selTopNav" ) too, but it still returned a 
>null value.
>
>Thanks,
>Tuan
>
>-Original Message-
>From: Thomas Eichberger [mailto:[EMAIL PROTECTED]]
>Sent: Monday, October 07, 2002 6:28 AM
>To: Struts Users Mailing List
>Cc: Struts Users Mailing List (E-mail)
>Subject: Re: Passing a request parameter within Struts framework
>
>
>request.getAttribute( "selTopNav" )
>
>not request.getParameter( "selTopNav" )
>
>!!!
>
>
>At 05:00 07.10.2002 -0700, Tuan H. Le wrote:
> >Hi,
> >
> >How do I pass a request attribute to another form? In my case, after a
> >successful login, it would forward the user to
> >the main form (MainMeu.jsp which has a frameset). In the main form, it has
> >several tabs. By default, it displays the
> >first tab.
> >
> >Currently, in the perform() method of LoginAction class, I have the
> >following code
> >
> >//...
> >request.setAttribute( "selTopNav", "1" );
> >return( mapping.findForward( target ) );
> >
> >
> >Here's the code for the MainMenu.jsp
> >
> >
> ><%@ page language="java" %>
> ><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> ><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> >
> >
> >
> >
> >And, in the Top.jsp, I have a test code to get a value of the request
> >attribute, but it always returns a null value
> >
> >Top Nav: <%= request.getParameter( "selTopNav" ) %>
> >
> >Here's a partial of my struts-config.xml file
> >
> >   
> >  > type="com.phs.ezhr.presentation.form.LoginForm" />
> >  > type="com.phs.ezhr.presentation.form.MainMenuForm" />
> >   
> >
> >   
> > 
> >   
> >
> >   
> >   
> > 
> >  > type="com.phs.ezhr.presentation.action.LoginAction"
> > validate="true"
> > input="/Login.jsp"
> > name="loginForm"
> > scope="session" >
> >  >  path="/MainMenu.jsp" />
> >  >  path="/Login.jsp" />
> > 
> > 
> >  > type="com.phs.ezhr.presentation.action.LogoffAction">
> > 
> > 
> >  > type="com.phs.ezhr.presentation.action.MainMenuAction"
> > validate="false"
> > input="/Top.jsp"
> > name="mainMenuForm"
> > scope="request" >
> > 
> >   
> >
> >
> >Do you know what I'm missing?
> >
> >Thanks,
> >Tuan
> >
> >
> >
> >--
> >To unsubscribe, 
> e-mail:   
> >For additional commands, e-mail: 
> 
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Form bean is null in pagecontext? - OK let's try this again...

2002-10-07 Thread Kevin Roast
Title: Message



OK, ignore my 
witterings :-) Since the object is in request scope it must be accessed 
thus:
 
BaseForm form = (BaseForm)pageContext.getAttribute(Constants.BEAN_KEY, 
pageContext.REQUEST_SCOPE);
 
This 
works fine.
 
My confusion 
stemmed from the fact that getAttribute() returns null when an item doesn't 
exist as opposed to throwing an error.
 
Kev

  
  -Original Message-From: Kevin Roast 
  Sent: 07 October 2002 12:16To: Struts Users Mailing 
  ListSubject: RE: Form bean is null in pagecontext? - OK let's try 
  this again...
  Hi,
   
  OK, it appears 
  that I'm using the wrong key here - i.e. I should be using BEAN_KEY to 
  get the Form bean not the form tag (doh).
   
  HOWEVER - this 
  doesn't explain why the ALL of the attributes on the request scope are "null" 
  e.g. I've printed them out to the console:
   
  org.apache.struts.taglib.html.FORM=nulldataForm=nullorg.apache.struts.taglib.html.BEAN=null
   
  I've looked at 
  the Struts code that sets the attributes in FormTag.doStartTag() and it 
  looks ok:
   
      // Store 
  this tag itself as a page 
  attribute    
  pageContext.setAttribute(Constants.FORM_KEY, this, 
  PageContext.REQUEST_SCOPE);
   
  Any ideas what's 
  going on here?
   
  Cheers,
   
  Kev
  

-Original Message-From: Kevin Roast 
Sent: 07 October 2002 10:28To: 
[EMAIL PROTECTED]Subject: Form bean is null in 
pagecontext? 
Hi, 
Does anyone know, at what point does the form 
bean get added to the pageContext as an attribute? (with the key 
org.apache.struts.taglib.html.Constants.FORM_KEY) 
The reason I ask, is that I have a custom tag 
that needs to access the form bean class directly (I have created a base 
form bean class with methods I require), and I'm trying to do something like 
this in the tag code:
BaseForm form = 
(BaseForm)pageContext.getAttribute(Constants.FORM_KEY); 
Where "BaseForm" is my form bean base class 
type. 
However this returns null. Any ideas? The form 
is specified as "request" scope in the config file. 
Thanks, 
Kev 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Re: Passing a request parameter within Struts framework

2002-10-07 Thread Luca Zago

Hi,
your problem is clear, and it has very few solutions :)
The problem is that you use frames. Every Frame in a different request,
then the request from your form..end at the page containing the 
frameset, and your request with your parameters set in your form ends 
here. All the pages inside the frames are different GET requests from 
the browser, then they cannot have access your parameters and 
attributess (belonging to you former request).
Solutions:
if your parameter is only a string you can build a string chain..in the 
src of your frame tag:
" 
name="top" id="top" frameborder="0" scrolling="no" noresize 
marginwidth="0" marginheight="0" framespacing="0">
In this case your new request wll have the parameter named myparameterName.
It's very unelegant solution but it could work
Second put your object in the user's session. it's resonable to put it 
in session after all, if I understand well, is an attribute of a user's 
profile.

A general suggestions, don't user frames in dynamic pages, you can have 
always problems with them, Jsp has a nice templating machanism, use that 
to build your header or footer.


Tuan H. Le wrote:
> Hi,
> 
> How do I pass a request attribute to another form? In my case, after a successful 
>login, it would forward the user to 
> the main form (MainMeu.jsp which has a frameset). In the main form, it has several 
>tabs. By default, it displays the
> first tab.
> 
> Currently, in the perform() method of LoginAction class, I have the following code
> 
> //...
> request.setAttribute( "selTopNav", "1" );
> return( mapping.findForward( target ) );
> 
> 
> Here's the code for the MainMenu.jsp
> 
> 
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> 
> 
> 
> 
> 
> 
> 
> marginwidth="0" marginheight="0" framespacing="0">
> 
> scrolling="yes" frameborder="0" noresize framespacing="0">
> marginheight="10" scrolling="no" frameborder="0" noresize framespacing="0">
> 
> marginwidth="0" marginheight="0" noresize framespacing="0">
> 
> 
> 
> 
> 
> 
> 
> And, in the Top.jsp, I have a test code to get a value of the request attribute, but 
>it always returns a null value
> 
> Top Nav: <%= request.getParameter( "selTopNav" ) %>
> 
> Here's a partial of my struts-config.xml file
> 
>   
> 
> type="com.phs.ezhr.presentation.form.MainMenuForm" />
>   
> 
>   
> 
>   
> 
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
> 
> 
> Do you know what I'm missing?
> 
> Thanks,
> Tuan
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

-- 
Luca Zago
Senior IT Developer
_

E-TREE S.p.a.  Via Fonderia 43 - 31100 Treviso (Italy)
phone +39.0422.3107
fax   +39.0422.310888
http://www.e-tree.com  http://www.webanana.com
_


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Hi,

I tried request.getAttribute( "selTopNav" ) too, but it still returned a null value.

Thanks,
Tuan

-Original Message-
From: Thomas Eichberger [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 6:28 AM
To: Struts Users Mailing List
Cc: Struts Users Mailing List (E-mail)
Subject: Re: Passing a request parameter within Struts framework


request.getAttribute( "selTopNav" )

not request.getParameter( "selTopNav" )

!!!


At 05:00 07.10.2002 -0700, Tuan H. Le wrote:
>Hi,
>
>How do I pass a request attribute to another form? In my case, after a 
>successful login, it would forward the user to
>the main form (MainMeu.jsp which has a frameset). In the main form, it has 
>several tabs. By default, it displays the
>first tab.
>
>Currently, in the perform() method of LoginAction class, I have the 
>following code
>
>//...
>request.setAttribute( "selTopNav", "1" );
>return( mapping.findForward( target ) );
>
>
>Here's the code for the MainMenu.jsp
>
>
><%@ page language="java" %>
><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
>
>
>
>And, in the Top.jsp, I have a test code to get a value of the request 
>attribute, but it always returns a null value
>
>Top Nav: <%= request.getParameter( "selTopNav" ) %>
>
>Here's a partial of my struts-config.xml file
>
>   
>  type="com.phs.ezhr.presentation.form.LoginForm" />
>  type="com.phs.ezhr.presentation.form.MainMenuForm" />
>   
>
>   
> 
>   
>
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
>
>
>Do you know what I'm missing?
>
>Thanks,
>Tuan
>
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Hi,

I added Andrew's code tip as below, but it still returns a null value for the request 
parameter.

public final class LoginAction extends Action {
  public ActionForward perform(  ) {
// . . .
ActionForward curForward = mapping.findForward( target );
String path = URLUtil.addParameterToURL( curForward.getPath(), "selTopNav", "1" );
System.out.println( path );
ActionForward newForward = new ActionForward( path, curForward.getRedirect() );
return newForward;
  }
}

public class URLUtil {
  public static String addParameterToURL( String anURL,
  String aParameter,
  String aValue ) {
if ( anURL == null ) {
  return aParameter + "=" + aValue;
} else {
  return anURL + ( (anURL.indexOf( "?" ) == -1) ? "?" : "&" ) + aParameter + "=" + 
aValue;
}
  }
}

-- MainMenu.jsp (where it get forwarded to for a successful login -
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>



















 Top.jsp (a frame within a frameset and where the request.getParameter get called) 
--

Selected Top Nav: <%= request.getParameter( "selTopNav" ) %>


This returns a null value instead of "1".

I must have missed some thing here.

Thanks,
Tuan



-Original Message-
From: Tuan H. Le 
Sent: Monday, October 07, 2002 6:02 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Andrew,

Thanks again for your help! I'm going to try your suggestion soon.

Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:41 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Had another look at your question and realised it is attributes rather than
parameters (Im always getting these mixed up!) that you stated in your
original question! (hehe guess my response was too quick!).
Given that this is the case, it should be useable in the next page unless
the forward is a redirecting forward.
Dont use jsp much so cant remember the 'best' way to expose it to the page,
but you could probably use a runtime expression thinghy (<%=
request.getAttribute("selTopNav"); %>

If however you need it as a request parameter the way I always do it is as
mentioned below and heres some code to illustrate:

firstly a simple method for adding parameters onto urls:
(btw: you can probably lose the first half of that "if" - Im just paranoid
about nulls ;->)

public static String addParameterToURL(String url, String parameter, String
value)
{
  if(url == null)
  {
return parameter + "=" + value;
  }
  else
  {
return url + ( (url.indexOf("?")==-1) ? "?" : "&" ) + parameter + "=" +
value;
  }
}

and to use this with forwards:

ActionForward fwd = mapping.findForward( target );
String path = addParameterToURL(forward.getPath(),"selTopNav","1");
ActionForward newFwd = new ActionForward(path,fwd.getRedirect() );
return newFwd;

-Original Message-
From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 20:19
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Andrew,

Thanks for a quick response! Do you have a sample code that I can use? It
seems to me that are several lines of code to complete your suggestion. Is
this the only way to pass a request parameter within the LoginAction to
another JSP page? Eventually, I need to pass the request parameter selTopNav
(the user's selected tab) value back and forth to determine which tab the
user has selected.

Thanks again!
Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:07 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


In your action you can create a new forward object and return that.
ie: get the forward for target, extract its url and append required
parameter(s) and create a new forward using that and the redirect value from
the one you looked up, and return the new one.

>  -Original Message-
> From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:01
> To:   Struts Users Mailing List (E-mail)
> Subject:  Passing a request parameter within Struts framework
>
> Hi,
>
> How do I pass a request attribute to another form? In my case, after a
successful login, it would forward the user to
> the main form (MainMeu.jsp which has a frameset). In the main form, it has
several tabs. By default, it displays the
> first tab.
>
> Currently, in the perform() method of LoginAction class, I have the
following code
>
> //...
> request.setAttribute( "selTopNav", "1" );
> return( mapping.findForward( target ) );
>
>
> Here's the code for the MainMenu.jsp
>
>
> <%@ page language="java" %>
> 

Re: Passing a request parameter within Struts framework

2002-10-07 Thread Thomas Eichberger

request.getAttribute( "selTopNav" )

not request.getParameter( "selTopNav" )

!!!


At 05:00 07.10.2002 -0700, Tuan H. Le wrote:
>Hi,
>
>How do I pass a request attribute to another form? In my case, after a 
>successful login, it would forward the user to
>the main form (MainMeu.jsp which has a frameset). In the main form, it has 
>several tabs. By default, it displays the
>first tab.
>
>Currently, in the perform() method of LoginAction class, I have the 
>following code
>
>//...
>request.setAttribute( "selTopNav", "1" );
>return( mapping.findForward( target ) );
>
>
>Here's the code for the MainMenu.jsp
>
>
><%@ page language="java" %>
><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
>
>
>
>And, in the Top.jsp, I have a test code to get a value of the request 
>attribute, but it always returns a null value
>
>Top Nav: <%= request.getParameter( "selTopNav" ) %>
>
>Here's a partial of my struts-config.xml file
>
>   
>  type="com.phs.ezhr.presentation.form.LoginForm" />
>  type="com.phs.ezhr.presentation.form.MainMenuForm" />
>   
>
>   
> 
>   
>
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
>
>
>Do you know what I'm missing?
>
>Thanks,
>Tuan
>
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[OT] Multinested exceptions class

2002-10-07 Thread Frederic Laub

Hi,

Sorry for polluting this newsgroup with this Java question on Exception
handling,
but I didn't succeed to implement the multi-nested exceptions class of
chapter 10
 of the Jakarta Struts Book Review:
http://www.theserverside.com/resources/strutsreview.jsp
and I thought I could borrow a few seconds from some Java Guru.

I have a main method that calls sequentially method A and than method B.
Method A and method B are throwing databaseException.
In the main method I want to process method B even if an exception is thrown
by method A.
The main method will throw an exception if errors occurred in method A
and/or method B,
the exception thrown by the main method will contain a collection of
exceptions.
I suppose the main method is a good candidate for this type of exception
handling?
In the main method:
 try {
  call method A
  } catch (DatabaseException e) {
   // LoadException extends BaseException which
   // has a Collection attribute, (among others) a method for adding an
exception
   // and one for retrieving the whole collections.
   LoadException loadException = new LoadException();
   loadException.addException(e);
   }
 try {
  call method B
  } catch (DatabaseException e) {
Question:  How do I add this DataBaseException to the previously created
loadException in method A?
   }
Question: Where do I put the code to read the collection of exceptions if
any?

An example or a link to a multi-nested exception example would be great!

Thank you for your time.
Frederic



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: [NESTED TAGS] Questions regarding nested:iterate and indexid....

2002-10-07 Thread Jeff_Mychasiw


Sorry I should have mentioned it.  I am using Tomcat 4.04/JBoss3.0  for
this test.

We are also planning to move to tomcat 4.1.12 asap.




[EMAIL PROTECTED] (David M. Karr) on 10/06/2002 04:24:25 PM

Please respond to "Struts Users Mailing List"
   <[EMAIL PROTECTED]>

To:[EMAIL PROTECTED]
cc:

Subject:Re: [NESTED TAGS] Questions regarding nested:iterate and
   indexid


> "Jeff" == Jeff Mychasiw <[EMAIL PROTECTED]> writes:

Jeff> I am using 1.1b1
Jeff> Summary: I cannot make use of the indexId reference in side a
java method, unless I specify an id="XX" attribute.
Jeff> The funny thing is that the id attribute can be named anything.

It may not be relevant, but it might be important to know what web
container
and version you're using.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


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








--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: question

2002-10-07 Thread Buchwald, Dave (PLC, IT, Tri-Com Consulting)

I'm on NT, but try...

for IE V5.5 try:  'Internet options', 'Advanced' tab, check the 'Reuse
windows for launching shortcuts'
for Mozilla V1.0 (sorry, best I could do but there should be something
similar for Netscape):
'Advanced', 'Scripts and Windows', uncheck 'Open a link in a new window'



-Original Message-
From: deepank [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 8:32 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re:  question


Hi,

This is how i am using the  tag for all my links invoking
different actions

[Form Review Team]
As u can see there is no use of "target" attribute

Funny part is that for all my links it opens a new window, if i keep the new
window open, all the links then open in this new window
That means i always have 2 windows open if i click on a link.
Is there some browser setting i need to check, i use IE5.5  and Netscape 6.2

Deepank


- Original Message -
From: "Andrew Hill" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 5:40 PM
Subject: RE:  question


> Wierd. Is it just for your struts app, or does any link in your browser do
> this (ie: some dodgy browser setting).
> If the former, take a look at what you have specified for your target
> attribute (if in doubt check the generated html of your page to see what
is
> really output to browser). If that window/frame does not exist the browser
> will open a new one.
>
> -Original Message-
> From: deepank [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:12
> To: Struts Users Mailing List
> Subject:  question
>
>
> Hi,
> why does  open the link in a new window, how can i prevent
this.
>
> Deepank
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:

For additional commands, e-mail:



This communication, including attachments, is for the exclusive use of 
addressee and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, any use, copying, 
disclosure, dissemination or distribution is strictly prohibited. If 
you are not the intended recipient, please notify the sender 
immediately by return email and delete this communication and destroy all copies.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Passing a request parameter within Struts framework

2002-10-07 Thread Divakar Satyanarayan

Andrew since this forward is getting generated dynamically how is it mapped
in the struts-config.. I mean how does it get resolved ?

> -Original Message-
> From: Andrew Hill [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 6:11 PM
> To:   Struts Users Mailing List
> Subject:  RE: Passing a request parameter within Struts framework
> 
> Had another look at your question and realised it is attributes rather
> than
> parameters (Im always getting these mixed up!) that you stated in your
> original question! (hehe guess my response was too quick!).
> Given that this is the case, it should be useable in the next page unless
> the forward is a redirecting forward.
> Dont use jsp much so cant remember the 'best' way to expose it to the
> page,
> but you could probably use a runtime expression thinghy (<%=
> request.getAttribute("selTopNav"); %>
> 
> If however you need it as a request parameter the way I always do it is as
> mentioned below and heres some code to illustrate:
> 
> firstly a simple method for adding parameters onto urls:
> (btw: you can probably lose the first half of that "if" - Im just paranoid
> about nulls ;->)
> 
> public static String addParameterToURL(String url, String parameter,
> String
> value)
> {
>   if(url == null)
>   {
> return parameter + "=" + value;
>   }
>   else
>   {
> return url + ( (url.indexOf("?")==-1) ? "?" : "&" ) + parameter + "="
> +
> value;
>   }
> }
> 
> and to use this with forwards:
> 
> ActionForward fwd = mapping.findForward( target );
> String path = addParameterToURL(forward.getPath(),"selTopNav","1");
> ActionForward newFwd = new ActionForward(path,fwd.getRedirect() );
> return newFwd;
> 
> -Original Message-
> From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:19
> To: Struts Users Mailing List
> Subject: RE: Passing a request parameter within Struts framework
> 
> 
> Andrew,
> 
> Thanks for a quick response! Do you have a sample code that I can use? It
> seems to me that are several lines of code to complete your suggestion. Is
> this the only way to pass a request parameter within the LoginAction to
> another JSP page? Eventually, I need to pass the request parameter
> selTopNav
> (the user's selected tab) value back and forth to determine which tab the
> user has selected.
> 
> Thanks again!
> Tuan
> 
> -Original Message-
> From: Andrew Hill [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 5:07 AM
> To: Struts Users Mailing List
> Subject: RE: Passing a request parameter within Struts framework
> 
> 
> In your action you can create a new forward object and return that.
> ie: get the forward for target, extract its url and append required
> parameter(s) and create a new forward using that and the redirect value
> from
> the one you looked up, and return the new one.
> 
> >  -Original Message-
> > From:   Tuan H. Le [mailto:[EMAIL PROTECTED]]
> > Sent:   Monday, October 07, 2002 20:01
> > To: Struts Users Mailing List (E-mail)
> > Subject:Passing a request parameter within Struts framework
> >
> > Hi,
> >
> > How do I pass a request attribute to another form? In my case, after a
> successful login, it would forward the user to
> > the main form (MainMeu.jsp which has a frameset). In the main form, it
> has
> several tabs. By default, it displays the
> > first tab.
> >
> > Currently, in the perform() method of LoginAction class, I have the
> following code
> >
> > //...
> > request.setAttribute( "selTopNav", "1" );
> > return( mapping.findForward( target ) );
> >
> >
> > Here's the code for the MainMenu.jsp
> >
> >
> > <%@ page language="java" %>
> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> >
> > 
> > 
> > 
> > 
> > 
> > 
> >  scrolling="no" noresize marginwidth="0" marginheight="0" framespacing="0">
> > 
> >  scrolling="yes" frameborder="0" noresize framespacing="0">
> >  marginheight="10" scrolling="no" frameborder="0" noresize
> framespacing="0">
> > 
> >  scrolling="no" marginwidth="0" marginheight="0" noresize framespacing="0">
> > 
> > 
> > 
> > 
> > 
> >
> >
> > And, in the Top.jsp, I have a test code to get a value of the request
> attribute, but it always returns a null value
> >
> > Top Nav: <%= request.getParameter( "selTopNav" ) %>
> >
> > Here's a partial of my struts-config.xml file
> >
> >   
> >  type="com.phs.ezhr.presentation.form.LoginForm" />
> >  type="com.phs.ezhr.presentation.form.MainMenuForm" />
> >   
> >
> >   
> > 
> >   
> >
> >   
> >   
> > 
> >  > type="com.phs.ezhr.presentation.action.LoginAction"
> > validate="true"
> > input="/Login.jsp"
> > name="loginForm"
> > scope="session" >
> >  >  path="/MainMenu.jsp" />
> >  >  path="/Login.jsp" />
> > 
> > 
> >

RE: Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Andrew,

Thanks again for your help! I'm going to try your suggestion soon.

Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:41 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Had another look at your question and realised it is attributes rather than
parameters (Im always getting these mixed up!) that you stated in your
original question! (hehe guess my response was too quick!).
Given that this is the case, it should be useable in the next page unless
the forward is a redirecting forward.
Dont use jsp much so cant remember the 'best' way to expose it to the page,
but you could probably use a runtime expression thinghy (<%=
request.getAttribute("selTopNav"); %>

If however you need it as a request parameter the way I always do it is as
mentioned below and heres some code to illustrate:

firstly a simple method for adding parameters onto urls:
(btw: you can probably lose the first half of that "if" - Im just paranoid
about nulls ;->)

public static String addParameterToURL(String url, String parameter, String
value)
{
  if(url == null)
  {
return parameter + "=" + value;
  }
  else
  {
return url + ( (url.indexOf("?")==-1) ? "?" : "&" ) + parameter + "=" +
value;
  }
}

and to use this with forwards:

ActionForward fwd = mapping.findForward( target );
String path = addParameterToURL(forward.getPath(),"selTopNav","1");
ActionForward newFwd = new ActionForward(path,fwd.getRedirect() );
return newFwd;

-Original Message-
From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 20:19
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Andrew,

Thanks for a quick response! Do you have a sample code that I can use? It
seems to me that are several lines of code to complete your suggestion. Is
this the only way to pass a request parameter within the LoginAction to
another JSP page? Eventually, I need to pass the request parameter selTopNav
(the user's selected tab) value back and forth to determine which tab the
user has selected.

Thanks again!
Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:07 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


In your action you can create a new forward object and return that.
ie: get the forward for target, extract its url and append required
parameter(s) and create a new forward using that and the redirect value from
the one you looked up, and return the new one.

>  -Original Message-
> From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:01
> To:   Struts Users Mailing List (E-mail)
> Subject:  Passing a request parameter within Struts framework
>
> Hi,
>
> How do I pass a request attribute to another form? In my case, after a
successful login, it would forward the user to
> the main form (MainMeu.jsp which has a frameset). In the main form, it has
several tabs. By default, it displays the
> first tab.
>
> Currently, in the perform() method of LoginAction class, I have the
following code
>
> //...
> request.setAttribute( "selTopNav", "1" );
> return( mapping.findForward( target ) );
>
>
> Here's the code for the MainMenu.jsp
>
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> And, in the Top.jsp, I have a test code to get a value of the request
attribute, but it always returns a null value
>
> Top Nav: <%= request.getParameter( "selTopNav" ) %>
>
> Here's a partial of my struts-config.xml file
>
>   
> 
> 
>   
>
>   
> 
>   
>
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
>
>
> Do you know what I'm missing?
>
> Thanks,
> Tuan
>
>  << File: ATT00078.txt >>


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:  

RE: Passing a request parameter within Struts framework

2002-10-07 Thread Andrew Hill

Had another look at your question and realised it is attributes rather than
parameters (Im always getting these mixed up!) that you stated in your
original question! (hehe guess my response was too quick!).
Given that this is the case, it should be useable in the next page unless
the forward is a redirecting forward.
Dont use jsp much so cant remember the 'best' way to expose it to the page,
but you could probably use a runtime expression thinghy (<%=
request.getAttribute("selTopNav"); %>

If however you need it as a request parameter the way I always do it is as
mentioned below and heres some code to illustrate:

firstly a simple method for adding parameters onto urls:
(btw: you can probably lose the first half of that "if" - Im just paranoid
about nulls ;->)

public static String addParameterToURL(String url, String parameter, String
value)
{
  if(url == null)
  {
return parameter + "=" + value;
  }
  else
  {
return url + ( (url.indexOf("?")==-1) ? "?" : "&" ) + parameter + "=" +
value;
  }
}

and to use this with forwards:

ActionForward fwd = mapping.findForward( target );
String path = addParameterToURL(forward.getPath(),"selTopNav","1");
ActionForward newFwd = new ActionForward(path,fwd.getRedirect() );
return newFwd;

-Original Message-
From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 20:19
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


Andrew,

Thanks for a quick response! Do you have a sample code that I can use? It
seems to me that are several lines of code to complete your suggestion. Is
this the only way to pass a request parameter within the LoginAction to
another JSP page? Eventually, I need to pass the request parameter selTopNav
(the user's selected tab) value back and forth to determine which tab the
user has selected.

Thanks again!
Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:07 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


In your action you can create a new forward object and return that.
ie: get the forward for target, extract its url and append required
parameter(s) and create a new forward using that and the redirect value from
the one you looked up, and return the new one.

>  -Original Message-
> From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:01
> To:   Struts Users Mailing List (E-mail)
> Subject:  Passing a request parameter within Struts framework
>
> Hi,
>
> How do I pass a request attribute to another form? In my case, after a
successful login, it would forward the user to
> the main form (MainMeu.jsp which has a frameset). In the main form, it has
several tabs. By default, it displays the
> first tab.
>
> Currently, in the perform() method of LoginAction class, I have the
following code
>
> //...
> request.setAttribute( "selTopNav", "1" );
> return( mapping.findForward( target ) );
>
>
> Here's the code for the MainMenu.jsp
>
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> And, in the Top.jsp, I have a test code to get a value of the request
attribute, but it always returns a null value
>
> Top Nav: <%= request.getParameter( "selTopNav" ) %>
>
> Here's a partial of my struts-config.xml file
>
>   
> 
> 
>   
>
>   
> 
>   
>
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
>
>
> Do you know what I'm missing?
>
> Thanks,
> Tuan
>
>  << File: ATT00078.txt >>


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread deepank

Hi,
I have been reading chapters from your book that are posted online to
understand Struts.
The book is great but think its not yet available here in bookstores. Will
you be posting chapter 8 anytime soon.
It will be of great help

Deepank

- Original Message -
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 5:49 PM
Subject: Re: Declarative Exception handling with Struts 1.1-b2


> If you haven't already, may I suggest you download the
> draft of Chapter 10 from my book. It covers Struts and
> Exception Handling (both programmatic and declarative).
>
> Here's a link:
> http://www.theserverside.com/resources/strutsreview.jsp
>
> Sorry for the shameless plug, but I think the material
> will help.
>
> Chuck
> > Hi,
> > Can anybody help me in understanding declarative exception handling with
> > Struts1.1b2? My requirement is maintaining only single "error.jsp" file,
> > which should be displayed when an exception is thrown. We are having
multiple
> > exception classes and when an exception is thrown an error id is
associated
> > with it to get appropriate message. If I put all the error code vs error
> > messages in ApplicationResources.properties, there should be a way to
fetch
> > the error code from the thrown exception, and then displaying the
appropriate
> > message. Any help is appriciated.
> > Thanks,
> > Harvinder
> >
> > --
> > To unsubscribe, e-mail:

> > For additional commands, e-mail:

> >
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: question

2002-10-07 Thread deepank

Hi,

This is how i am using the  tag for all my links invoking
different actions

[Form Review Team]
As u can see there is no use of "target" attribute

Funny part is that for all my links it opens a new window, if i keep the new
window open, all the links then open in this new window
That means i always have 2 windows open if i click on a link.
Is there some browser setting i need to check, i use IE5.5  and Netscape 6.2

Deepank


- Original Message -
From: "Andrew Hill" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 5:40 PM
Subject: RE:  question


> Wierd. Is it just for your struts app, or does any link in your browser do
> this (ie: some dodgy browser setting).
> If the former, take a look at what you have specified for your target
> attribute (if in doubt check the generated html of your page to see what
is
> really output to browser). If that window/frame does not exist the browser
> will open a new one.
>
> -Original Message-
> From: deepank [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:12
> To: Struts Users Mailing List
> Subject:  question
>
>
> Hi,
> why does  open the link in a new window, how can i prevent
this.
>
> Deepank
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread chuckcavaness

If you haven't already, may I suggest you download the 
draft of Chapter 10 from my book. It covers Struts and 
Exception Handling (both programmatic and declarative). 

Here's a link:
http://www.theserverside.com/resources/strutsreview.jsp

Sorry for the shameless plug, but I think the material 
will help.

Chuck
> Hi,
> Can anybody help me in understanding declarative exception handling with
> Struts1.1b2? My requirement is maintaining only single "error.jsp" file,
> which should be displayed when an exception is thrown. We are having multiple
> exception classes and when an exception is thrown an error id is associated
> with it to get appropriate message. If I put all the error code vs error
> messages in ApplicationResources.properties, there should be a way to fetch
> the error code from the thrown exception, and then displaying the appropriate
> message. Any help is appriciated.
> Thanks,
> Harvinder
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Andrew,

Thanks for a quick response! Do you have a sample code that I can use? It seems to me 
that are several lines of code to complete your suggestion. Is this the only way to 
pass a request parameter within the LoginAction to another JSP page? Eventually, I 
need to pass the request parameter selTopNav (the user's selected tab) value back and 
forth to determine which tab the user has selected.

Thanks again!
Tuan

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 5:07 AM
To: Struts Users Mailing List
Subject: RE: Passing a request parameter within Struts framework


In your action you can create a new forward object and return that.
ie: get the forward for target, extract its url and append required
parameter(s) and create a new forward using that and the redirect value from
the one you looked up, and return the new one.

>  -Original Message-
> From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:01
> To:   Struts Users Mailing List (E-mail)
> Subject:  Passing a request parameter within Struts framework
>
> Hi,
>
> How do I pass a request attribute to another form? In my case, after a
successful login, it would forward the user to
> the main form (MainMeu.jsp which has a frameset). In the main form, it has
several tabs. By default, it displays the
> first tab.
>
> Currently, in the perform() method of LoginAction class, I have the
following code
>
> //...
> request.setAttribute( "selTopNav", "1" );
> return( mapping.findForward( target ) );
>
>
> Here's the code for the MainMenu.jsp
>
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> And, in the Top.jsp, I have a test code to get a value of the request
attribute, but it always returns a null value
>
> Top Nav: <%= request.getParameter( "selTopNav" ) %>
>
> Here's a partial of my struts-config.xml file
>
>   
> 
> 
>   
>
>   
> 
>   
>
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
>
>
> Do you know what I'm missing?
>
> Thanks,
> Tuan
>
>  << File: ATT00078.txt >>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: question

2002-10-07 Thread Andrew Hill

Wierd. Is it just for your struts app, or does any link in your browser do
this (ie: some dodgy browser setting).
If the former, take a look at what you have specified for your target
attribute (if in doubt check the generated html of your page to see what is
really output to browser). If that window/frame does not exist the browser
will open a new one.

-Original Message-
From: deepank [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 20:12
To: Struts Users Mailing List
Subject:  question


Hi,
why does  open the link in a new window, how can i prevent this.

Deepank


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: question

2002-10-07 Thread Pavel Kolesnikov

On Mon, 7 Oct 2002, deepank wrote:

> Hi,
> why does  open the link in a new window, how can i prevent this.

I'm sure it does not by default.

Check out attributes of your  tag and attributes of generated 
HTML tag. There may be also some  in your HTML document.

Pavel



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Passing a request parameter within Struts framework

2002-10-07 Thread Andrew Hill

In your action you can create a new forward object and return that.
ie: get the forward for target, extract its url and append required
parameter(s) and create a new forward using that and the redirect value from
the one you looked up, and return the new one.

>  -Original Message-
> From: Tuan H. Le [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 07, 2002 20:01
> To:   Struts Users Mailing List (E-mail)
> Subject:  Passing a request parameter within Struts framework
>
> Hi,
>
> How do I pass a request attribute to another form? In my case, after a
successful login, it would forward the user to
> the main form (MainMeu.jsp which has a frameset). In the main form, it has
several tabs. By default, it displays the
> first tab.
>
> Currently, in the perform() method of LoginAction class, I have the
following code
>
> //...
> request.setAttribute( "selTopNav", "1" );
> return( mapping.findForward( target ) );
>
>
> Here's the code for the MainMenu.jsp
>
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> And, in the Top.jsp, I have a test code to get a value of the request
attribute, but it always returns a null value
>
> Top Nav: <%= request.getParameter( "selTopNav" ) %>
>
> Here's a partial of my struts-config.xml file
>
>   
> 
> 
>   
>
>   
> 
>   
>
>   
>   
> 
>  type="com.phs.ezhr.presentation.action.LoginAction"
> validate="true"
> input="/Login.jsp"
> name="loginForm"
> scope="session" >
>   path="/MainMenu.jsp" />
>   path="/Login.jsp" />
> 
> 
>  type="com.phs.ezhr.presentation.action.LogoffAction">
> 
> 
>  type="com.phs.ezhr.presentation.action.MainMenuAction"
> validate="false"
> input="/Top.jsp"
> name="mainMenuForm"
> scope="request" >
> 
>   
>
>
> Do you know what I'm missing?
>
> Thanks,
> Tuan
>
>  << File: ATT00078.txt >>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Order or multivalued paramter

2002-10-07 Thread Andrew Hill

I believe so (at least Im relying on it in my apps!) at least under IE5 and
NS6/Mozilla it seems to.
(I havent seen a spec document stating it, but I havent looked either!).


Interestingly if you use client side DOM manipulation to reorder those
fields on the page, in IE they will submit in the new order, but in NS they
will still submit in the old order. :-(


-Original Message-
From: Gemes Tibor [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 19:53
To: [EMAIL PROTECTED]
Subject: Order or multivalued paramter


If a form has multiple input field with the same name, will the order be
preserved?

Eg my form is like this:







Will myForm.getTestParm() return the {"one", "two", "three", "four", "five"}
array for all the case?

Can I depend on it?

Tib

--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Same Action Class, same form, more submits

2002-10-07 Thread Andrew Hill

Take a look at the DispatchAction. This does the same thing you are but
saves you some typing.

The reason why you get null in the second case is that for the html:image
tag the browser doesnt submit the value when clicked but rather submits the
x and y position of the mouse when the image was clicked using the
parameters bob.x and bob.y (where bob=whatever you specified for property).
(This isnt struts fault, but rather the brilliant way way html was defiend
to work).

This makes it a damn nuisance working out which image was clicked (short of
resorting to JavaScript to set a hidden field in the images onclick or
append a parameter to the form action). Using html:submit of course works
the way one wants it to, which is why your code works.

-Original Message-
From: Luca Zago [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 19:48
To: Struts Users Mailing List
Subject: Same Action Class, same form, more submits


Hi,
I noticed in devoloping with struts a design problem, probably because I
don't know well the framework :)
I mean that the main risk with struts is devoloping a lot of action
classes for every micro functionality.
For example I often have a form, and in this form two submits
which must call different functions on the same data submitted by the
form. I would like to have the same action class for all the operations
I can perform on the same submitted data.
If my submits are:




I can distinguish between the sumit seleceted by the user, with a
control on the request parameter "action" inside the Action class and
then excute different operations according to the user submit choice.
But this is a tricky, not a nice pattern, first the value is the same
string showed on the page.. second if I use a




this doesn't work anymore..because the request "action" parameter is null.
Has somebody an idea to solve this problem? Or is there in struts a
better design pattern to face this problem?

Thank in advance to all,
Luca




--
Luca Zago
Senior IT Developer
_

E-TREE S.p.a.  Via Fonderia 43 - 31100 Treviso (Italy)
phone +39.0422.3107
fax   +39.0422.310888
http://www.e-tree.com  http://www.webanana.com
_


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




question

2002-10-07 Thread deepank

Hi,
why does  open the link in a new window, how can i prevent this.

Deepank



Passing a request parameter within Struts framework

2002-10-07 Thread Tuan H. Le

Hi,

How do I pass a request attribute to another form? In my case, after a successful 
login, it would forward the user to 
the main form (MainMeu.jsp which has a frameset). In the main form, it has several 
tabs. By default, it displays the
first tab.

Currently, in the perform() method of LoginAction class, I have the following code

//...
request.setAttribute( "selTopNav", "1" );
return( mapping.findForward( target ) );


Here's the code for the MainMenu.jsp


<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>




















And, in the Top.jsp, I have a test code to get a value of the request attribute, but 
it always returns a null value

Top Nav: <%= request.getParameter( "selTopNav" ) %>

Here's a partial of my struts-config.xml file

  


  

  

  

  
  











  


Do you know what I'm missing?

Thanks,
Tuan



<>
--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Order or multivalued paramter

2002-10-07 Thread Gemes Tibor

If a form has multiple input field with the same name, will the order be 
preserved?

Eg my form is like this:







Will myForm.getTestParm() return the {"one", "two", "three", "four", "five"} 
array for all the case? 

Can I depend on it?

Tib

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Same Action Class, same form, more submits

2002-10-07 Thread Luca Zago

Hi,
I noticed in devoloping with struts a design problem, probably because I 
don't know well the framework :)
I mean that the main risk with struts is devoloping a lot of action 
classes for every micro functionality.
For example I often have a form, and in this form two submits
which must call different functions on the same data submitted by the 
form. I would like to have the same action class for all the operations 
I can perform on the same submitted data.
If my submits are:




I can distinguish between the sumit seleceted by the user, with a 
control on the request parameter "action" inside the Action class and 
then excute different operations according to the user submit choice.
But this is a tricky, not a nice pattern, first the value is the same 
string showed on the page.. second if I use a




this doesn't work anymore..because the request "action" parameter is null.
Has somebody an idea to solve this problem? Or is there in struts a 
better design pattern to face this problem?

Thank in advance to all,
Luca




-- 
Luca Zago
Senior IT Developer
_

E-TREE S.p.a.  Via Fonderia 43 - 31100 Treviso (Italy)
phone +39.0422.3107
fax   +39.0422.310888
http://www.e-tree.com  http://www.webanana.com
_


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Specifying button-specific actions in a form

2002-10-07 Thread Pavel Kolesnikov

On 7 Oct 2002, K Br wrote:

> I prefer to use DIspatchAction, as I think its neater.
> Is there a way for me to tell DispatchAction to
> use different forms beans for different methods?

I don't think so. Try to explain why do you think
you need different form beans for that.

Pavel



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Declarative Exception handling with Struts 1.1-b2

2002-10-07 Thread Harvinder Singh

Hi,
Can anybody help me in understanding declarative exception handling with
Struts1.1b2? My requirement is maintaining only single "error.jsp" file,
which should be displayed when an exception is thrown. We are having multiple
exception classes and when an exception is thrown an error id is associated
with it to get appropriate message. If I put all the error code vs error
messages in ApplicationResources.properties, there should be a way to fetch
the error code from the thrown exception, and then displaying the appropriate
message. Any help is appriciated.
Thanks,
Harvinder

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Form bean is null in pagecontext? - OK let's try this again...

2002-10-07 Thread Kevin Roast
Title: Message



Hi,
 
OK, it appears that 
I'm using the wrong key here - i.e. I should be using BEAN_KEY to get the 
Form bean not the form tag (doh).
 
HOWEVER - this 
doesn't explain why the ALL of the attributes on the request scope are "null" 
e.g. I've printed them out to the console:
 
org.apache.struts.taglib.html.FORM=nulldataForm=nullorg.apache.struts.taglib.html.BEAN=null
 
I've looked at the 
Struts code that sets the attributes in FormTag.doStartTag() and it looks 
ok:
 
    // Store 
this tag itself as a page 
attribute    
pageContext.setAttribute(Constants.FORM_KEY, this, 
PageContext.REQUEST_SCOPE);
 
Any ideas what's 
going on here?
 
Cheers,
 
Kev

  
  -Original Message-From: Kevin Roast 
  Sent: 07 October 2002 10:28To: 
  [EMAIL PROTECTED]Subject: Form bean is null in 
  pagecontext? 
  Hi, 
  Does anyone know, at what point does the form bean 
  get added to the pageContext as an attribute? (with the key org.apache.struts.taglib.html.Constants.FORM_KEY) 
  
  The reason I ask, is that I have a custom tag that 
  needs to access the form bean class directly (I have created a base form bean 
  class with methods I require), and I'm trying to do something like this in the 
  tag code:
  BaseForm form = 
  (BaseForm)pageContext.getAttribute(Constants.FORM_KEY); 
  Where "BaseForm" is my form bean base class 
  type. 
  However this returns null. Any ideas? The form is 
  specified as "request" scope in the config file. 
  Thanks, 
  Kev 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Form bean is null in pagecontext?

2002-10-07 Thread Kevin Roast
Title: Form bean is null in pagecontext? 






Hi,


Does anyone know, at what point does the form bean get added to the pageContext as an attribute? (with the key 

org.apache.struts.taglib.html.Constants.FORM_KEY)


The reason I ask, is that I have a custom tag that needs to access the form bean class directly (I have created a base form bean class with methods I require), and I'm trying to do something like this in the tag code:


BaseForm form = (BaseForm)pageContext.getAttribute(Constants.FORM_KEY);



Where "BaseForm" is my form bean base class type.


However this returns null. Any ideas? The form is specified as "request" scope in the config file.


Thanks,


Kev

--

+44 (0)1628 589125

[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: BeanUtils getPropertyDescriptor error

2002-10-07 Thread Daniel Haynes

The answer to both the questions is "yes". Thanks for the re-assurance.

Dan

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: 04 October 2002 17:37
To: Struts Users Mailing List
Subject: Re: BeanUtils getPropertyDescriptor error




On Fri, 4 Oct 2002, Daniel Haynes wrote:

> Date: Fri, 4 Oct 2002 10:06:42 +0100
> From: Daniel Haynes <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: "Struts-User (E-mail)" <[EMAIL PROTECTED]>
> Subject: BeanUtils getPropertyDescriptor error
>
> Hi,
>
> Having gone live with our webapp (and changed the logging) an error stated
> to appear in our logs. However the app is functioning fine. Is this error
a
> problem ? The error occurs with submitions from jsps which contain radio
> buttons. In our action class we extract the request parameters to
establish
> the state(s) of the radio buttons to process the request.
>
> Is all this ok or am I missing something here ?
>

Is this happening during the population of the form bean (which Struts
does for you)?  Do the exception messages show up only in the debug
messages, and not cause problems in your application itself?

If the answer to both questions is "yes", then this is harmless.  The
BeanUtils.populate() method operates like this:
- Iterate over the keys in the Map that is passed in (i.e. over
  the names of all request parameters included in the request)
- If there is a matching property on the destination bean,
  do the appropriate set
- If there is no matching property on the destination bean,
  ignore this request parameter

The exception is being triggered by the getPropertyDescriptor() call used
to test the third condition.

Craig

> (We are using Struts 1.1)
>
>
> 2002-10-03 17:03:35,765 DEBUG [BeanUtils]
> BeanUtils.populate(com.rule.approve.ApproveForm@c18e99,
> {detailsList[5].qualityID=[Ljava.lang.String;@fba68,
> detailsList[10].qualityID=[Ljava.lang.String;@970991,
> detailsList[6].qualityID=[Ljava.lang.String;@f53870,
> detailsList[11].qualityID=[Ljava.lang.String;@4c4ac9,
> detailsList[7].qualityID=[Ljava.lang.String;@c1e333,
> detailsList[8].qualityID=[Ljava.lang.String;@2b3574,
> detailsList[9].qualityID=[Ljava.lang.String;@c27081,
> action=[Ljava.lang.String;@685be9,
> detailsList[0].qualityID=[Ljava.lang.String;@6a1fbe,
> detailsList[1].qualityID=[Ljava.lang.String;@4a0fe1,
> detailsList[2].qualityID=[Ljava.lang.String;@589d3d,
> detailsList[3].qualityID=[Ljava.lang.String;@bb1bc4,
> detailsList[4].qualityID=[Ljava.lang.String;@1bfefb})
> 2002-10-03 17:03:35,765 DEBUG [BeanUtils]
> name='detailsList[5].qualityID', value.class='[Ljava.lang.String;',
> value='[Ljava.lang.String;@fba68'
> 2002-10-03 17:03:35,781 DEBUG [BeanUtils] getPropertyDescriptor
> java.lang.NoSuchMethodException: Unknown property 'detailsList'
>   at
>
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.
> java:416)
>   at
>
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.
> java:363)
>   at
>
org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUti
> ls.java:770)
>   at
> org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:501)
>   at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:952)
>   at
>
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j
> ava:795)
>   at
>
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:244)
>   at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
>   at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:470)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>   at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
>   at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
>   at com.rule.common.filters.TimerFilter.doFilter(TimerFilter.java:36)
>   at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:213)
>   at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
>   at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:243)
>   at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
>   at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
>   at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>   at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:190)
>   at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
>   at
>
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
> .java:528)

RE: O'Reilly struts book

2002-10-07 Thread Stephen . Thompson

Chuck,

I know this might be cheeky, but would it be possible to post the chapters
that got axed in their current state or are you planning a follow-up book?

Regards,

Stephen.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 04 October 2002 18:23
To: Struts Users Mailing List
Subject: Re: O'Reilly struts book


I'm reviewing the final PDF version of the book right 
now and will be done with that in a week. It should be 
heading for the printer right after that and be out very 
soon.

Since several chapters had to be cut for size, the Table 
of contents was slightly reorganized and renumbered. 
Every chapter except one (chapter 8) was posted that 
will be included with the book. The TOC that is shown on 
theserverside review site 
(http://www.theserverside.com/resources/strutsreview.jsp)
 is correct. Of those chapters, only the custom tag 
chapter was never posted. This was because I was re-
writing it right up until my deadline.

Look through the available chapters by name, don't worry 
about the chapter number. That has been adjusted in the 
final version. But just so you won't be disappointed, 
the TOC on that page is correct. Several chapters 
(unfortunately like security) had to be axed to keep the 
book at a respectable size.

Chuck
> I see that this won't be out (here in the UK at least) until the end of
> November.
> 
> Been reading the review chapters that were available on theserverside, but
> there are a couple of chapters missing... does anybody out there have
> chapters 8, 15, 17 and 19? Perhaps these were never made available, but it
> would be great to have a look at them without having to wait 2 months for
> publication.. i promise i will buy the book when it becomes available :~)
> 
> Thanks in advance,
> 
> d
> 
> 
> 
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

> 

--
To unsubscribe, e-mail:

For additional commands, e-mail:



---

Copyright material and/or confidential and/or privileged information may be contained 
in this e-mail and any attached documents.  The material and information is intended 
for the use of the intended addressee only.  If you are not the intended addressee, or 
the person responsible for delivering it to the intended addressee, you may not copy, 
disclose, distribute, disseminate or deliver it to anyone else or use it in any 
unauthorised manner or take or omit to take any action in reliance on it. To do so is 
prohibited and may be unlawful.   The views expressed in this e-mail may not be 
official policy but the personal views of the originator.  If you receive this e-mail 
in error, please advise the sender immediately by using the reply facility in your 
e-mail software, or contact [EMAIL PROTECTED]  Please also delete this e-mail and 
all documents attached immediately.  
Many thanks for your co-operation.

BMW Financial Services (GB) Limited is registered in England and Wales under company 
number 01288537.
Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF
--

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Q: Validator - query properties

2002-10-07 Thread gernot . pfingstl

If a html input field is required I use the validator plugin and put 
...depends="required"... in my validation.xml file. This works great!
In the jsp pages I mark required fields with a "*", until now I
hardcode the "*" in my jsps, so if I change a field to required I had
to put the "*" in the jsp and to change the validation.xml.
My intend is to write a jsp tag, which parses the validation.xml
and put the "*" automatically, if the filed is required.

e.g. 

Had I to parse the validation.xml manually or is there a api
call to query validation properties? Due to the fact that dependencies could
depend on the locale, it would be nice to have a api and not to parse it
manually.

Thanks, Gernot


-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Günstige DSL- & Modem/ISDN-Tarife!


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: html:form focus causes a javascript error if the element is aradio button

2002-10-07 Thread Gilles . Vandaele


Hi sweet archangel of the list,

Having had a look at those bugs (12248 and 1586 ) it seems that the problem
is that javascript is uncorrectly generated for an indexed field.
Does it mean that we have to know before the generation if the field is an
indexed one? eg. do we need to add the [0] in the tag attribute for a radio
button?
My problem is that I don't know (at creating the JSP), what kind of input
field the focus will have to be set on.
I thought that the focus attribute had to be set as 'The field name to
which initial focus will be assigned with a JavaScript function.'
(struts-documentation 1.0.2). They don't talk about any index!












Gilles Vandaele
0498 52 64 12
[EMAIL PROTECTED]


   
  
   Gilles.Vandaele@smal
  
   s-mvm.be To:Struts Users Mailing List   
  
   <[EMAIL PROTECTED]>
  
   04/10/2002 17:06 cc:
  
Subject:  Re: html:form focus causes a 
javascript error if the   
   element is a radio button   
  
   
  
Please respond to Struts Users Mailing 
List  
   
  
   
  
   
  





Got it.
Tx.

Gilles Vandaele
0498 52 64 12
[EMAIL PROTECTED]



   Eddie Bush

   <[EMAIL PROTECTED]>  To:Struts Users Mailing
List

<[EMAIL PROTECTED]>
   04/10/2002 16:46 cc:

Subject:  Re: html:form focus
causes a javascript error if the
   element is a radio
button

Please respond to Struts Users
Mailing List







Ask Bugzilla :-)  http://issues.apache.org/bugzilla

[EMAIL PROTECTED] wrote:

>Hi there funny crew,
>
>did someone allready noticed  that Struts's html:form tag generate this
>kind of javascript:...
>
>document.forms["AnyFormName"].elements["anyFieldName"].focus()
>
>...to give the focus to the element 'anyFieldName'  of the form , and that
>it causes a javascript error if the element is a radio button.
>
>My JSP is generated and I cannot guess whish type of element will be first
>focussed.
>
>I guess that the tag have to generate this:
>document.forms["AnyFormName"].elements["anyFieldName"][0].focus()
>in the case of radio button input element.
>
>Is it a bug or am I wrong? Will I have to set the focus in a scriptlet?
>
>
>
>Gilles Vandaele
>0498 52 64 12
>[EMAIL PROTECTED] Vandaele
>0498 52 64 12
>[EMAIL PROTECTED]
>

--
Eddie Bush




--
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:   
For additional commands, e-mail: 




RE: Cannot find bean error

2002-10-07 Thread Anoop

I checked these out, and seems correct. Are there anything specific issues
which have to be looked into.

Anoop.

-Original Message-
From: deepank [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 1:12 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: Cannot find bean error


Hi,
 I am not sure about this, but i have had this problem. Make sure your bean
follows the specifications of a Bean.
All properties have getter/setter methods. Sometimes Struts(or reflection i
should say)  will not recognize your class as bean because if this.
Also double check if your storing it in some scope in your Action class.

Deepank


- Original Message -
From: "Anoop" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 12:30 PM
Subject: Cannot find bean error


> Hi,
>
> I am trying to loop through an ArrayList returnd by a bean inside
> 
>
> Name in the Iterator tag specifies a bean set in request scope in my
> ActionBean, getter on which will return an ArrayList. I am trying to read
> the bean returned by the ArrayList inside the Iterator tag. There is an
> exception thrown:
>
> javax.servlet.ServletException: Cannot find bean EMTTaskDetail in scope
> null
>
> I tried specifying all the possible scopes, session and request but it
still
> throw this exception
>
> The scriptlet looks something like this:
>
>  property="taskDetails">
>
>   
>
>  property="taskName"/> ...
>
> getTaskDetails() on the bean set in the request scope with key
> "timesheetDetails" returns an ArrayList of EMTTaskDetail objects.
>
> Thanks for your help.
>
> Thanks & Regards,
> Anoop.
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Cannot find bean error

2002-10-07 Thread deepank

Hi,
 I am not sure about this, but i have had this problem. Make sure your bean
follows the specifications of a Bean.
All properties have getter/setter methods. Sometimes Struts(or reflection i
should say)  will not recognize your class as bean because if this.
Also double check if your storing it in some scope in your Action class.

Deepank


- Original Message -
From: "Anoop" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 07, 2002 12:30 PM
Subject: Cannot find bean error


> Hi,
>
> I am trying to loop through an ArrayList returnd by a bean inside
> 
>
> Name in the Iterator tag specifies a bean set in request scope in my
> ActionBean, getter on which will return an ArrayList. I am trying to read
> the bean returned by the ArrayList inside the Iterator tag. There is an
> exception thrown:
>
> javax.servlet.ServletException: Cannot find bean EMTTaskDetail in scope
> null
>
> I tried specifying all the possible scopes, session and request but it
still
> throw this exception
>
> The scriptlet looks something like this:
>
>  property="taskDetails">
>
>   
>
>  property="taskName"/> ...
>
> getTaskDetails() on the bean set in the request scope with key
> "timesheetDetails" returns an ArrayList of EMTTaskDetail objects.
>
> Thanks for your help.
>
> Thanks & Regards,
> Anoop.
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Cannot find bean error

2002-10-07 Thread Victor CHEVALIER

javax.servlet.ServletException: Cannot find bean EMTTaskDetail in scope null

This doesn't mean your scope is not valid but that there is no bean in the
scope you specified. So if you specified no scope, this mean there is no
bean in 'memory'.
Verify the tag  (logic taglib definition).

On another side, if you iterate through an array of specified Objects, you
must provide a type in the iterate tag.

-Message d'origine-
De : Anoop [mailto:[EMAIL PROTECTED]]
Envoyé : lundi 7 octobre 2002 09:00
À : [EMAIL PROTECTED]
Objet : Cannot find bean error


Hi,

I am trying to loop through an ArrayList returnd by a bean inside


Name in the Iterator tag specifies a bean set in request scope in my
ActionBean, getter on which will return an ArrayList. I am trying to read
the bean returned by the ArrayList inside the Iterator tag. There is an
exception thrown:

javax.servlet.ServletException: Cannot find bean EMTTaskDetail in scope
null

I tried specifying all the possible scopes, session and request but it still
throw this exception

The scriptlet looks something like this:



  

 ...

getTaskDetails() on the bean set in the request scope with key
"timesheetDetails" returns an ArrayList of EMTTaskDetail objects.

Thanks for your help.

Thanks & Regards,
Anoop.


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: