Re: Best way to forward to login, then re-forward to originally requestedresource?

2002-05-29 Thread Adam Hardy

I wouild save the form bean and a mapping or action forward in the 
session, and collect them when the in-between task is finished.

Rick Mann wrote:

on 5/28/02 5:19 PM, Alex Paransky at [EMAIL PROTECTED] wrote:

  

Why not use J2EE/WEB standard container authentication?  It will do what you
want.  In fact, it was designed to do what you want, which is called Lazy,
or just in time, authentication.  The user can surf your page, however, when
he links to a protected item, a login page (of your choosing) will be
displayed.  After the user is authenticated, the proceeds to the protected
resource.



Well, let's say for the sake of argument, that it's not authentication we're
talking about. Let's say, instead, that in order to perform some Action B,
some other Action A must be done first. However, doing A does not
necessarily mean you'll do B next. What's the best way to remember that B
was what the user wanted to do, but forward them to A first?

  




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




Brain Teaser

2002-05-29 Thread Chris Cairns

Could someone explain to me what the path attribute for the action mappings 
element is for?  I know it's the path of the action, but what sort of file 
is it?  jsp?

struts-config
form-beans
form-bean
   name=logonForm
   type=org.apache.struts.example.LogonForm /
/form-beans global-forwards
   type=org.apache.struts.action.ActionForward /
forward name=logon path=/logon.jsp
  redirect=false / /global-forwards

action-mappings action
 path=/logon
 type=org.apache.struts.example.LogonAction
 name=logonForm
scope=request
input=/logon.jsp
  unknown=false
 validate=true / /action-mappings
/struts-config


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




RE: Brain Teaser

2002-05-29 Thread Andrew Hill

My understanding is that its anything you can forward to - ie: jsp, servlet,
another action

-Original Message-
From: Chris Cairns [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 15:23
To: [EMAIL PROTECTED]
Subject: Brain Teaser


Could someone explain to me what the path attribute for the action mappings
element is for?  I know it's the path of the action, but what sort of file
is it?  jsp?

struts-config
form-beans
form-bean
   name=logonForm
   type=org.apache.struts.example.LogonForm /
/form-beans global-forwards
   type=org.apache.struts.action.ActionForward /
forward name=logon path=/logon.jsp
  redirect=false / /global-forwards

action-mappings action
 path=/logon
 type=org.apache.struts.example.LogonAction
 name=logonForm
scope=request
input=/logon.jsp
  unknown=false
 validate=true / /action-mappings
/struts-config


--
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]




Higher level html tags

2002-05-29 Thread Dejan Bosanac

Hi,
Are there any plans within struts project for making higher level html
tags in taglib, e.g. calendar tag that prints out three select boxes
automatically or something similar. Could anyone please point me to
resources about this topic or some alternative solutions that can be
integrated with struts.
Thanks,
Dejan



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




R: Brain Teaser

2002-05-29 Thread daniele rizzi


That's easy!
It's not a file, just a name to be called in html:form
action=logon/html:form

bye,
d.rizzi


-Messaggio originale-
Da: Chris Cairns [mailto:[EMAIL PROTECTED]]
Inviato: mercoledi 29 maggio 2002 9.23
A: [EMAIL PROTECTED]
Oggetto: Brain Teaser


Could someone explain to me what the path attribute for the action mappings
element is for?  I know it's the path of the action, but what sort of file
is it?  jsp?

struts-config
form-beans
form-bean
   name=logonForm
   type=org.apache.struts.example.LogonForm /
/form-beans global-forwards
   type=org.apache.struts.action.ActionForward /
forward name=logon path=/logon.jsp
  redirect=false / /global-forwards

action-mappings action
 path=/logon
 type=org.apache.struts.example.LogonAction
 name=logonForm
scope=request
input=/logon.jsp
  unknown=false
 validate=true / /action-mappings
/struts-config


--
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]




Re: Higher level html tags

2002-05-29 Thread Jin Bal

You could write a custom tag to do just this as I have done, which accepts
date objects or strings for the individual field names.
Alternatively there is a calender taglib in the jakarta taglibs I believe

HTH

Jin
- Original Message -
From: Dejan Bosanac [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 29, 2002 8:41 AM
Subject: Higher level html tags


 Hi,
 Are there any plans within struts project for making higher level html
 tags in taglib, e.g. calendar tag that prints out three select boxes
 automatically or something similar. Could anyone please point me to
 resources about this topic or some alternative solutions that can be
 integrated with struts.
 Thanks,
 Dejan



 --
 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]




Re: Action classes/Form based authentication/ EJBs

2002-05-29 Thread @Basebeans.com

Subject: Re: Action classes/Form based authentication/ EJBs
From: Torgeir Veimo [EMAIL PROTECTED]
 ===
Roland Chan wrote:
 Hi There,
  
 Using BASIC authentication my action classes work like a charm. However,
 when I switched to form based authentication calls to secured EJBs
 present an authentication exception, principal=null error.
  
 This is strange only because I know the principal exists and was
 authenticated. What is stranger is my workaround: I can get the
 authentication to work for my EJBs just by calling logging the
 request.getRemoteUser() from within my action. Why should I need to do
 this? I thought this sort of thing is handled by the container.

This is probably a problem of lost session, either by the browser not 
sending the session cookie back or while using url rewriting and not 
properly wrapping an url sent back to the browser.

Remember that when using basic authentication, the auth header is sent 
by the browser at every request, so it never looses the session. Using 
form based authentication requires the session to be intact, since you 
only authenticate once.


-- 
-Torgeir


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




Re: Best way to forward to login, then re-forward to originallyrequested resource?

2002-05-29 Thread Rick Mann

on 5/28/02 11:59 PM, Adam Hardy at [EMAIL PROTECTED] wrote:

 I wouild save the form bean and a mapping or action forward in the
 session, and collect them when the in-between task is finished.

Yeah, I was thinking of that, too.

Okay, so here's the struts-specific problem: how do I get the name of the
action in a way that I can use later to generate an ActionForward? If I call
mapping.getPath(), I get the path used in the mapping, but it will be
outside of the pattern set up in the deployment descriptor. Typically, it
will not end in .do.

Right now, I do this:

forward = new ActionForward();
forward.setContextRelative(true);
forward.setPath(originalResource + .do);

This works, but won't work if the original resource was a .jsp. (I'd like to
put a tag at the top of a JSP to check for a valid login). In fact, it
doesn't work in the general case (say the deployment action servlet mapping
is /action/* instead of *.do).

Perhaps I just don't understand container-managed security well enough. How
can I cause one of my User objects to be created in the session when the
user gets authenticated? As far as what's provided by the server, it just
sets a user name (and principal) available to servlets. I suppose I could
look for the user, and if it's not found, create one based on the result of
isUserInRole() et al., but it just seems less than elegant. I'll post a more
general question to the Tomcat list.


-- 
Rick



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




Re: Higher level html tags

2002-05-29 Thread Dejan Bosanac

Hi Jin,
Thanks for the answer. I know I could write it on my own, I just don't won't
to go out of the main development stream or reinventing the wheel.
I couldn't find such a tag in jakarta taglib, but I will look again.
Regards,
Dejan

 You could write a custom tag to do just this as I have done, which accepts
 date objects or strings for the individual field names.
 Alternatively there is a calender taglib in the jakarta taglibs I believe

 HTH

 Jin
 - Original Message -
 From: Dejan Bosanac [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, May 29, 2002 8:41 AM
 Subject: Higher level html tags


  Hi,
  Are there any plans within struts project for making higher level html
  tags in taglib, e.g. calendar tag that prints out three select boxes
  automatically or something similar. Could anyone please point me to
  resources about this topic or some alternative solutions that can be
  integrated with struts.
  Thanks,
  Dejan
 
 
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 

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



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




Re: Struts 1.1 multiple config doubt by radhika

2002-05-29 Thread Cedric Dumoulin


  Hello,

  According to your configuration file web.xml, your sub-application struts config 
file should
be at /WEB-INF/struts-config-appl2.xml. Also, pages files for your sub-application 
should be in
a subfolder called appl2 in the root directory of your main application.
  You don't need a subfolder called appl2 inside WEB-INF.

Hope this help,
 Cedric

Radhika Nadkarni wrote:

 Hi,
 I have a problem related to configuring multiple struts config file in
 Struts 1.1.

 The following is the code snippet added in web.xml :-

 init-param
   param-nameconfig/param-name
   param-value/WEB-INF/struts-config.xml/param-value
 /init-param

 init-param
   param-nameconfig/appl2/param-name
   param-value/WEB-INF/struts-config-appl2.xml/param-value
 /init-param

 I have put the two config files in web-inf folder of Weblogic. However, I
 have created another folder by the name appl2 inside web-inf wherein I
 have put all the classes for the 2nd application (appl2). This is all that i
 have done for sub-applications.
 But, when I load the 2nd application, its not finding the
 struts-config-appl2.xml file and am getting the following error : -
 javax.servlet.jsp.JspException: Cannot retrieve mapping for action
 /logonNewConfig
 at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:828)
 at
 org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:528)
 at jsp_servlet.__app1content._jspService(__app1content.java:165)
 at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
 at
 weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
 at
 weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
 at
 weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
 at
 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2456)
 at
 weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
 at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
 at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

 where /logonNewConfig is the action specified in the struts-config-appl2.xml
 file.

 Please reply asap

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

 --
 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]




Re: R: Brain Teaser

2002-05-29 Thread Arron Bates

Daniele's right, but to make things a little clearer than tag semantics...

In web.xml, there's a servlet mapping url-pattern attribute which 
tells the servlet to throw things onto the Struts servlet, of which we 
tell it to react a certain way via struts-config.xml.

The action-mapping path in struts-config.xml is used in the form 
attribute, tells the struts servlet as to what action class we're going 
to use to process the request after its finished its input processing 
business.

Otherwise struts servlet wont know what to do with itself and starts to 
use your machines processing power to play chess with Big Blue over your 
internet connection*


Arron.

* The part about playing chess with Big Blue could be complete bulls--t.
It will play chess with whatever's available, even Fujitsu mainframe.


daniele rizzi wrote:

That's easy!
It's not a file, just a name to be called in html:form
action=logon/html:form

bye,
d.rizzi


-Messaggio originale-
Da: Chris Cairns [mailto:[EMAIL PROTECTED]]
Inviato: mercoledi 29 maggio 2002 9.23
A: [EMAIL PROTECTED]
Oggetto: Brain Teaser


Could someone explain to me what the path attribute for the action mappings
element is for?  I know it's the path of the action, but what sort of file
is it?  jsp?

struts-config
form-beans
form-bean
   name=logonForm
   type=org.apache.struts.example.LogonForm /
/form-beans global-forwards
   type=org.apache.struts.action.ActionForward /
forward name=logon path=/logon.jsp
  redirect=false / /global-forwards

action-mappings action
 path=/logon
 type=org.apache.struts.example.LogonAction
 name=logonForm
scope=request
input=/logon.jsp
  unknown=false
 validate=true / /action-mappings
/struts-config


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



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





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




Re: R: validator generated HTML code

2002-05-29 Thread Adolfo Miguelez


Thanks David,

I made it work and it is fine. We have a different file for static 
javascript.

However I still wonder one question about validator-rules.xml scope file and 
static javascript file. We think that the idea would be to have a unique 
validator-rules.xml for the full set of webbapps, a shared one, which would 
contains the available validators for our company. By following this 
approach, would be silly that a page downloads the full bundle of javascript 
for each webapp, since probably a lot of them can even not be used by this 
application.

Therefore, we guess that validator-rules.xml is intended to be a distinct 
file per webapp. IMHO, this would have the problem that each development 
team, carring out a different webapp, would have to maintain each own 
validator-rules.xml rather than taking advantage of a general one.

Is it fine or did I misundertand anything? Opinions welcome.

Adolfo.

From: David Winterfeldt [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: R: validator generated HTML code
Date: Tue, 28 May 2002 13:27:40 -0700 (PDT)

It makes it very difficult to debug the JavaScript
when all whitespace is stripped out.  The best thing
to do if you are concerned about the extra download
size of the web page (I am assuming this is the
concern) is to make a separate page for the generic
JavaScript functions.  There is an example of this in
the Validator webapp.

Creating a Separate Page for Static JavaScript
If you want to just generate the dynamic JavaScript on
you form page and have a separate page with the static
JavaScript to take advantage of browser caching you
can use the dynamicJavascript and staticJavascript
attributes to the JavascriptValidatorTag. You can turn
each attribute's generation of JavaScript on and off
by putting in true or false (they default to true).
Reference jsType.jsp and staticJavascript.jsp in the
main example webapp for a working example.

In your form page:
 validator:javascript formName=typeForm
dynamicJavascript=true staticJavascript=false/
 script language=Javascript1.1
src=staticJavascript.jsp/script

In your static JavaScript page.
 %@ page contentType=application/x-javascript %
 validator:javascript dynamicJavascript=false
staticJavascript=true/



David

--- Adolfo Miguelez [EMAIL PROTECTED] wrote:
 
  however, if, as you say, all are loaded in bundle,
  is this not overhead for
  the web server, since HTML generated pages are much
  conger. Could not this
  be optimized in validator framework?
 
  Just a sugestion,
 
  regards and thanks,
 
  Adolfo.
 
  From: Adolfo Miguelez [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List
  [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: Re: R: validator generated HTML code
  Date: Tue, 28 May 2002 14:57:16 +
  
  
  cheers daniele
  
  From: daniele rizzi [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List
  [EMAIL PROTECTED]
  To: Struts Users Mailing List
  [EMAIL PROTECTED]
  Subject: R: validator generated HTML code
  Date: Tue, 28 May 2002 16:38:15 +0200
  
  
  Hi,
  you're not the only one studying this stuff! As
  far as I may know
  (after 3 days  nigths of hard work) the answers
  are:
  
  ---q1
  --Can I get rid of the other functions?
  
  No, they're loaded in bundle, but you can always
  get into
  the validator-rule.xml and remove what you don't
  like
  
  ---q2
  --i notice that i get a lot of \n characters in
  between the lines...
  
  oh, open the file with textpad and substitute any
  \n\n with \n
  
  (maybe the writer worked on a pc, then sent the
  code to a unix box,
  so every \n became a \n\n)
  
  like it?
  bye, daniele rizzi
  
  
  -Messaggio originale-
  Da: Adolfo Miguelez [mailto:[EMAIL PROTECTED]]
  Inviato: martedì 28 maggio 2002 16.25
  A: [EMAIL PROTECTED]
  Oggetto: validator generated HTML code
  
  
  
  Hi All,
  
  i have been checking the validator framework and i
  have some issues for
  yuo.
  First a, probably silly, question. I place in my
  JSP:
   onsubmit=return
  validateLoginForm(this);
  in the html:form and
   html:javascript formName=LoginForm/.
  
  The result is that I am getting all the javascript
  functions present in my
  validator-rules.xml file in the generated HTML,
  i.e:
  
  function validateShort(form)
  function validateMask(form)
  function validateCreditCard(form)
  function validateEmail(form)
  function validateMaxLength(form)
  function validateDate(form)
  function validateFloat(form)
  function validateRange(form)
  function validateMinLength(form)
  function validateRequired(form)
  function validateInteger(form)
  function validateByte(form)
  
  I suppose, I should only get the necessary
  functions for my validation, in
  my case function validateRequired(form). What am I
  doing wrong or missing?
  Can I get rid of the other functions?
  
  Secondly, i notice that i get a lot of \n
  

Re: Tiles, Tomcat 4.0.3 - Bill wins?!

2002-05-29 Thread Cedric Dumoulin


  Hello,

  We have find a trick allowing Tiles examples run on Solaris. The latest Tiles 
version allows a default vale for the
faulty attribute 'classtype' in item  So, it is possible to remove all these 
attributes from config files, and
Tiles should run fine. But, you still not be able to use the attribute in your project 
until we found where  the
problem is.

   Cedric

Krzysztof Czarny wrote:

 Hi everybody,
   I'm trying to start using tiles with Struts 1.0 and
 Tomcat. I've installed Tomcat using binary
 distribution on Solaris 8. I've downloaded tiles from
 Cedric Dumoulin Tiles site and to begin with tiles
 I've copied tiles-doc.war to tomcat's webapps/
 directory. I got an error displayed below.
 When I did the same with Windows version of Tomcat
 distribution everything went OK.
 It is obviously configuration issue, but I spent quite
 a lot of time on inspecting an error and finally found
 nothing :-(((.
 Do I really have to move to Windows ???!!

 The error:
 2002-05-23 14:21:10 action: Fail to load Tiles
 definition factory
 org.apache.struts.tiles.DefinitionsFactoryException:
 Error while parsing file '/WEB-INF/tiles-defs.xml'.
 Error at (64, 63: arg
 ument type mismatch
 at
 
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFile(I18nFactorySet.java:476)
 at
 
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.parseXmlFiles(I18nFactorySet.java:404)
 at
 
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.createDefaultFactory(I18nFactorySet.java:231)
 at
 
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:204)
 at
 
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.initFactory(I18nFactorySet.java:152)
 at
 org.apache.struts.tiles.xmlDefinition.I18nFactorySet.init(I18nFactorySet.java:105)
 at
 
org.apache.struts.tiles.definition.ReloadableDefinitionsFactory.createFactory(ReloadableDefinitionsFactory.java:143
 )
 at
 
org.apache.struts.tiles.definition.ReloadableDefinitionsFactory.init(ReloadableDefinitionsFactory.java:50)
 at
 
org.apache.struts.tiles.DefinitionsUtil.createDefinitionsFactory(DefinitionsUtil.java:163)
 at
 
org.apache.struts.tiles.ActionComponentServlet.initComponentDefinitionsMapping(ActionComponentServlet.java:65)
 at
 org.apache.struts.tiles.ActionComponentServlet.init(ActionComponentServlet.java:53)
 at
 javax.servlet.GenericServlet.init(GenericServlet.java:258)
 at
 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:916)
 at
 org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
 at
 org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3266)
 at
 org.apache.catalina.core.StandardContext.start(StandardContext.java:3395)
 at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
 at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
 at
 org.apache.catalina.core.StandardHost.install(StandardHost.java:714)
 at
 org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:324)
 at
 org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
 at
 org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
 at
 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
 at
 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
 at
 org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
 at
 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
 at
 org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
 at
 org.apache.catalina.core.StandardService.start(StandardService.java:388)
 at
 org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
 at
 org.apache.catalina.startup.Catalina.start(Catalina.java:781)
 at
 org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
 at
 org.apache.catalina.startup.Catalina.process(Catalina.java:179)
 at java.lang.reflect.Method.invoke(Native
 Method)
 at
 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

 __
 Do You Yahoo!?
 LAUNCH - Your Yahoo! Music Experience
 http://launch.yahoo.com

 --
 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]




RE: Best way to forward to login,then re-forward to originally requested resource?

2002-05-29 Thread Alex Paransky

Rick,

I recently had a similar problem.  Using J2EE security, I was not sure how
to detect a user login.  After all, a user can go into ANY protected page,
and I did not want to put the same tag in to EVERY single .JSP page that was
protected.

The solution, at least in my case, came in a form a filter.  I installed a
filter, which checks every single request to the server.  For each request,
I check to see if the user is authenticated by retrieving the principal.
When I detect that the user has logged in, I perform some action, and note
in the session that this has been done before.

This works for me

Here is my doFilter code:

final HttpServletRequest
  request = (HttpServletRequest) req;

final HttpSession
  session = request.getSession(false);

if (session != null  session.getAttribute(USER_LOGIN_CHECK) == null) {
  final Principal principal = request.getUserPrincipal();

  if (principal != null) {
session.setAttribute(USER_LOGIN_CHECK, new Boolean(true));
action.userLoggedIn(principal.getName(), req, res);
  }
}

chain.doFilter(req, res);

-AP_
http://www.myprofiles.com/member/profile/apara_personal

-Original Message-
From: Rick Mann [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 1:02 AM
To: Struts Users Mailing List
Subject: Re: Best way to forward to login, then re-forward to originally
requested resource?


on 5/28/02 11:59 PM, Adam Hardy at [EMAIL PROTECTED] wrote:

 I wouild save the form bean and a mapping or action forward in the
 session, and collect them when the in-between task is finished.

Yeah, I was thinking of that, too.

Okay, so here's the struts-specific problem: how do I get the name of the
action in a way that I can use later to generate an ActionForward? If I call
mapping.getPath(), I get the path used in the mapping, but it will be
outside of the pattern set up in the deployment descriptor. Typically, it
will not end in .do.

Right now, I do this:

forward = new ActionForward();
forward.setContextRelative(true);
forward.setPath(originalResource + .do);

This works, but won't work if the original resource was a .jsp. (I'd like to
put a tag at the top of a JSP to check for a valid login). In fact, it
doesn't work in the general case (say the deployment action servlet mapping
is /action/* instead of *.do).

Perhaps I just don't understand container-managed security well enough. How
can I cause one of my User objects to be created in the session when the
user gets authenticated? As far as what's provided by the server, it just
sets a user name (and principal) available to servlets. I suppose I could
look for the user, and if it's not found, create one based on the result of
isUserInRole() et al., but it just seems less than elegant. I'll post a more
general question to the Tomcat list.


--
Rick



--
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]




which datatype best for Javabean datetime for use in struts ?

2002-05-29 Thread Stephen Riek


I really like the method of auto-filling Javabeans from ResultSets described
by Ted Husted  in the earlier thread Re: Performance, Reflection, and Object 
Creation vs. Cacheing. 

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14397.html

However, my Javabeans currently use the Long datatype for storing a value
which is stored in the RDB's DATETIME field.
(This Long value is converted to something like 2002-05-24 12:34:22 using 
java.text.SimpleDateFormat and viceversa using java.text.ParsePosition.)

If I wish to use the method described by Ted Husted using ResultSetUtils,
what is the most appropriate datatype to use for storing dates, datetimes 
and timestamps in my Javabean ? Thank you.

By the way, where can I get the full ResultSetUtils.java ?

Stephen



-
Sign up to watch the FIFA World Cup video highlights from your desk!

http://fifaworldcup.yahoo.com/fc/en


No nested:message tag?

2002-05-29 Thread Rick Mann

It seems that nested:message / is left out. Is this the case? If so, why?

TIA,
-- 
Rick



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




ResoruceClass instead of Propertiesfile

2002-05-29 Thread mhanel

Is there a possibility to use ResourceClasses instead of
ResorucePropertiesfieles?

Thanks Matthias





Hanel Matthias
Fachinformatiker (Anwendungsentwicklung) in Ausbildung
Logistik World GmbH Fon:+49-841-9014-300
Marie-Curie-Strasse 6   Fax:+49-841-9014-302 
D- 85055 Ingolstadt mailto:[EMAIL PROTECTED]




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




Re: Best way to forward to login, then re-forward to originallyrequestedresource?

2002-05-29 Thread Reinhard Nägele

Save mapping in session and go to login page:

session.setAttribute(REDIRECT_KEY, mapping);
return mapping.findForward(login);


In your login action, check if a mapping is in the session and go there:

ActionMapping redirectMapping =
(ActionMapping) session.getAttribute(REDIRECT_KEY);
if (redirectMapping != null) {
session.removeAttribute(REDIRECT_KEY);
return new ActionForward(redirectMapping.getInput());
}


Reinhard


Rick Mann wrote:

on 5/28/02 11:59 PM, Adam Hardy at [EMAIL PROTECTED] wrote:

  

I wouild save the form bean and a mapping or action forward in the
session, and collect them when the in-between task is finished.



Yeah, I was thinking of that, too.

Okay, so here's the struts-specific problem: how do I get the name of the
action in a way that I can use later to generate an ActionForward? If I call
mapping.getPath(), I get the path used in the mapping, but it will be
outside of the pattern set up in the deployment descriptor. Typically, it
will not end in .do.

Right now, I do this:

forward = new ActionForward();
forward.setContextRelative(true);
forward.setPath(originalResource + .do);

This works, but won't work if the original resource was a .jsp. (I'd like to
put a tag at the top of a JSP to check for a valid login). In fact, it
doesn't work in the general case (say the deployment action servlet mapping
is /action/* instead of *.do).

Perhaps I just don't understand container-managed security well enough. How
can I cause one of my User objects to be created in the session when the
user gets authenticated? As far as what's provided by the server, it just
sets a user name (and principal) available to servlets. I suppose I could
look for the user, and if it's not found, create one based on the result of
isUserInRole() et al., but it just seems less than elegant. I'll post a more
general question to the Tomcat list.


  


-- 
Reinhard Nägele
MGM EDV-Beratung GmbH
Frankfurter Ring 105 a
80807 München
Tel.: +49 89 358680-817
Fax: +49 89 358680-88
E-Mail: [EMAIL PROTECTED]
Web: www.mgm-edv.de




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




Urgent :problem redirecting the page

2002-05-29 Thread siraj

hello everybody ,

  i am facing one problem while redircting a page.
 i have many links in my page with diffrent levles say category1,category2
whenever i click on any link i am passing the level and oid as parameter and
the page will be refreshed.
while refreshing i am also loading one more page in another frame. in which
i am checking the level and redirecting the control.
here everything is working fine for first time. the next time when i click
on the link the action is not called,  it simply calls the jsp

is there any way i can call the action each time when i redirect

i am using the following code

logic:equal name=strFlag value=catalog
logic:redirect page=/jsp/catalog/pdm_viewcatalog.do /
 /logic:equal
  logic:equal name=strFlag value=item
  logic:redirect page=/jsp/catalog/pdm_viewcatalog.do /
  /logic:equal




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




Tags generating custom tags

2002-05-29 Thread Tim Sawyer

Hello.

I'm trying to write a generic progress bar for my site.  I will be implementing it as 
a custom tag on the page, which then renders in the browser as the HTML required for 
the links.

I've just realised that what I want to generate is html:link tags, but that won't 
work will it?  Won't I have to generate pure HTML, the same HTML that html:link 
would output?

How do I implement this?

Cheers,

Tim.



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




Re: Action classes/Form based authentication/ EJBs

2002-05-29 Thread Adam Hardy

Pardon my ignorance please but what is basic authentication and 
form-based authentication?  You were talking about sessions and URL 
rewriting and I thought I knew all about that. What is the auth header 
from the browser? Is this container managed ?

Thanks
Adam

Struts Newsgroup (@Basebeans.com) wrote:

This is probably a problem of lost session, either by the browser not 
sending the session cookie back or while using url rewriting and not 
properly wrapping an url sent back to the browser.

Remember that when using basic authentication, the auth header is sent 
by the browser at every request, so it never looses the session. Using 
form based authentication requires the session to be intact, since you 
only authenticate once.


  




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




ServletException with Nested Taglib and Template Taglib in Struts 1b1

2002-05-29 Thread DEZALAY david - SOP ( [EMAIL PROTECTED] )

Hi all,

I'm trying to use Nested and Template taglibs in Struts R1B1.
It seems it doesn't work together.
I have a ServletException in the DoEndTag() method of Insert Tag (Template
taglib).
If I remove my template stuff in my JSPs (I keep Nested stuff only), it
works propertly.

Is there someone who could help me?
Thanks



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




Re: Action classes/Form based authentication/ EJBs

2002-05-29 Thread Dejan Bosanac

Hi,
- basic or digest authorization is HTTP-based authorazition. It's
situation when browser pops up a dialog box for user to enter username and
password for that domain. Server checks wheater authorization data (it's
word basic followed by base64 encoded string (username:password)) are in
request header which is sent by browser and if this is the case (and
user:pass pair is correct) page is returned. If not server returns 401
(Unauthorized) page and following line in header WWW-Authenticate: BASIC
realm=protected-domain which force the browser to pop up the dialog. It is
not a big protection but better then none. This basic authentication is in
Web server domain. You can control this behavior from your servlet (or
similair):

String authorization = request.getHeader(Authorization);
if (authorization == null) {
response.setStatus(response.SC_UNAUTHORIZED);
response.setHeader(WWW-Authenticate, BASIC
realm=\protected-domain\);
} else {
// check username and password
// if wrong
response.setStatus(response.SC_UNAUTHORIZED);
response.setHeader(WWW-Authenticate, BASIC
realm=\protected-domain\);
// else do what you want to do
}

//THIS IS JUST A DEMO CODE

- form-based authorization is situation where server initiates session with
browser by sending him a cookie with a sessionid and later can check if the
user is logged in (s/he is if has a cookie).

Hope I helped,
Dejan

 Pardon my ignorance please but what is basic authentication and
 form-based authentication?  You were talking about sessions and URL
 rewriting and I thought I knew all about that. What is the auth header
 from the browser? Is this container managed ?

 Thanks
 Adam

 Struts Newsgroup (@Basebeans.com) wrote:

 This is probably a problem of lost session, either by the browser not
 sending the session cookie back or while using url rewriting and not
 properly wrapping an url sent back to the browser.
 
 Remember that when using basic authentication, the auth header is sent
 by the browser at every request, so it never looses the session. Using
 form based authentication requires the session to be intact, since you
 only authenticate once.
 
 
 
 



 --
 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]




BeanUtils.populate() throws IllegalArgumentException for indexed String properties.

2002-05-29 Thread Jerome Jacobsen

Got no answer on this one from commons-dev mailing list.  Can someone here
can help?
---

Maybe I'm misunderstanding BeanUtils.populate, but shouldn't this work!
The exception says

IllegalArgumentException: type mismatch

Tried this with both BeanUtils 1.2 and 1.3 with same results.

---
public class Company {
private List m_locations = new ArrayList();

public String[] getLocation() {
return (String[])m_locations.toArray(new String[0]);
}

public String getLocation(
int index) {

return (String)m_locations.get(index);
}

public void setLocation(
String[] locations) {

if (locations == null) {
locations = new String[0];
}

m_locations = Arrays.asList(locations);
}

public void setLocation(
int index,
String location) {

m_locations.set(index, location);
}

public static void main(String[] args) throws Exception {
Company gentoo = new Company();

Map properties = new HashMap();
properties.put(location, new String[] {Blacksburg, Richmond});

BeanUtils.populate(gentoo, properties);  // throws
IllegalArgumentException!
}
}


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




Re: No nested:message tag?

2002-05-29 Thread Arron Bates

Because you have to manage the keys yourself, there's no automation to 
it. They're not locked in to using beans and their properties, which is 
what the nested tags are all about.

The nested tags only extend the tags which can benefit from the nested 
context. The errors tag is the same way, and any other tag which doesn't 
work off a bean/property combination.

It could be made so the message tag's property works off the same 
system, but I'm at odds as to its real benefit. What's your case to want 
it?... it may be enough to get me there.


Arron.


Rick Mann wrote:

It seems that nested:message / is left out. Is this the case? If so, why?

TIA,




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




Re: ServletException with Nested Taglib and Template Taglib in Struts 1b1

2002-05-29 Thread Arron Bates

What's the servlet container you're using (and what's the servlet/JSP 
spec does it run)?...

JSP 1.1 doesn't like includes inside tags, JSP 1.2 container should be fine.


Arron.


DEZALAY david - SOP ( [EMAIL PROTECTED] ) wrote:

Hi all,

I'm trying to use Nested and Template taglibs in Struts R1B1.
It seems it doesn't work together.
I have a ServletException in the DoEndTag() method of Insert Tag (Template
taglib).
If I remove my template stuff in my JSPs (I keep Nested stuff only), it
works propertly.

Is there someone who could help me?
Thanks



--
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]




redirect=true mappings with Websphere 4

2002-05-29 Thread Nicolas De Loof

Hi,

My application (based on Struts 1.0.2) uses the context greco, and I have
some Actions with forward defined like this with a redirect flag :

action   path=/oneAction
  type=greco.webapp.MyAction
  name=MyForm
  scope=request
  input=/one.jsp
  forward name=success path=/otherAction.do redirect=true/
/action

On websphere 4.0.2, I get a curious behaviour : When a browser calls
http://www.myserver.com/greco/oneAction.do
I'm redirected to
http://www.myserver.com/greco/greco/otherAction.do  (two times greco)

Did someone notice such context string duplication on redirect ?
Do you have any solution to avoid it ?

Nico



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




RE: Best way to forward to login, then re-forward to originally requested resource?

2002-05-29 Thread Tero P Paananen

 Well, let's say for the sake of argument, that it's not 
 authentication we're talking about. Let's say, instead,
 that in order to perform  some Action B,
 some other Action A must be done first. However, doing A does not
 necessarily mean you'll do B next. What's the best way to 
 remember that B was what the user wanted to do, but
 forward them to A first?

WebSphere uses a cookie to store this information when
you're using container based authentication.

Tomcat uses a session attribute.

-TPP

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




Re: Best way to forward to login, then re-forward to originally requested resource?

2002-05-29 Thread Charles Brault

This question seems to come up frequently, probably should be in a FAQ. 
Using Servlet Filters is one approach. If you are using Struts 1.1 (in 
1.0.2 it's slightly different), and want to use a Struts approach, try 
the following.

I have an application that requires everyone to log in and certain 
information to be in session before anything else can be done. In order 
to prevent users from bookmarking a page and jumping into it without 
having first logged in, I have to check every incoming request for a 
valid session.

IMHO, the easiest way to do this is to override one or more methods in 
the RequestProcessor (if you are using Struts 1.1). If you don't have 
the Struts source you need to obtain it and look at: 
org.apache.struts.action.RequestProcessor. The processPreprocess method 
simply returns true on each invocation. However, if you override the 
original code, and add your own checks, you can filter all the 
incoming requests for anything that's relevant to your situation.

For example, in the following, we check to see if the incoming request 
is one of 3 possible pages, returning true if it is, false otherwise. 
Obviously, you'd need to do other things to handle other types of pages.

public class TDRequestProcessor extends RequestProcessor {

protected boolean processPreprocess(HttpServletRequest request,
 HttpServletResponse response) {




String requri =  request.getRequestURI();

// first check the URI, if it's Splash, help  or index.jsp, user   
 is 
attempting to login
String path = requri.substring(requri.lastIndexOf(/) + 1);

if (path.equalsIgnoreCase(splash) ||  
path.equalsIgnoreCase(logon)|| 
path.equalsIgnoreCase(index.jsp)
|| path.equalsIgnoreCase(logonhelp)) {
return true;
}

return false;

}



}


Every request will funnel through this method. So you can check for 
objects in session and take appropriate forwarding actions if you don't 
obtain what's expected.

You will need to add the following to the bottom (check the TLD for the 
exact location) of the struts-config.xml file:

controller
processorClass=com.topdrawer.action.TDRequestProcessor
/controller



-- 
Charles E Brault
[EMAIL PROTECTED]
Where are we going, and why am I in this handbasket?


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




Re: redirect=true mappings with Websphere 4

2002-05-29 Thread Raffy_Lata


What happens if you take the slash out of the path? ie path
=otherAction.do




Nicolas De Loof [EMAIL PROTECTED] on 05/29/2002 06:28:35 AM

Please respond to Struts Users Mailing List
  [EMAIL PROTECTED]

To:   Struts Users Mailing List [EMAIL PROTECTED]
cc:
Subject:  redirect=true mappings with Websphere 4


Hi,

My application (based on Struts 1.0.2) uses the context greco, and I have
some Actions with forward defined like this with a redirect flag :

action   path=/oneAction
  type=greco.webapp.MyAction
  name=MyForm
  scope=request
  input=/one.jsp
  forward name=success path=/otherAction.do redirect=true/
/action

On websphere 4.0.2, I get a curious behaviour : When a browser calls
http://www.myserver.com/greco/oneAction.do
I'm redirected to
http://www.myserver.com/greco/greco/otherAction.do  (two times greco)

Did someone notice such context string duplication on redirect ?
Do you have any solution to avoid it ?

Nico



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






**
Please Note:
The information in this E-mail message, and any files transmitted
with it, is confidential and may be legally privileged.  It is
intended only for the use of the individual(s) named above.  If you
are the intended recipient, be aware that your use of any confidential
or personal information may be restricted by state and federal
privacy laws.  If you, the reader of this message, are not the
intended recipient, you are hereby notified that you should not
further disseminate, distribute, or forward this E-mail message.
If you have received this E-mail in error, please notify the sender
and delete the material from any computer.  Thank you.
**




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




Re: redirect=true mappings with Websphere 4

2002-05-29 Thread Nicolas De Loof

same behaviour ...


 What happens if you take the slash out of the path? ie path
 =otherAction.do




 Nicolas De Loof [EMAIL PROTECTED] on 05/29/2002 06:28:35 AM

 Please respond to Struts Users Mailing List
   [EMAIL PROTECTED]

 To:   Struts Users Mailing List [EMAIL PROTECTED]
 cc:
 Subject:  redirect=true mappings with Websphere 4


 Hi,

 My application (based on Struts 1.0.2) uses the context greco, and I
have
 some Actions with forward defined like this with a redirect flag :

 action   path=/oneAction
   type=greco.webapp.MyAction
   name=MyForm
   scope=request
   input=/one.jsp
   forward name=success path=/otherAction.do redirect=true/
 /action

 On websphere 4.0.2, I get a curious behaviour : When a browser calls
 http://www.myserver.com/greco/oneAction.do
 I'm redirected to
 http://www.myserver.com/greco/greco/otherAction.do  (two times greco)

 Did someone notice such context string duplication on redirect ?
 Do you have any solution to avoid it ?

 Nico



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






 **
 Please Note:
 The information in this E-mail message, and any files transmitted
 with it, is confidential and may be legally privileged.  It is
 intended only for the use of the individual(s) named above.  If you
 are the intended recipient, be aware that your use of any confidential
 or personal information may be restricted by state and federal
 privacy laws.  If you, the reader of this message, are not the
 intended recipient, you are hereby notified that you should not
 further disseminate, distribute, or forward this E-mail message.
 If you have received this E-mail in error, please notify the sender
 and delete the material from any computer.  Thank you.
 **




 --
 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]




Want ActionForward to be ignored, just using HttpServletResponse

2002-05-29 Thread struts-user

I have an Action subclass that will be called from an applet. I just need the Action 
class to serialize objects to the client using the HttpServletResponse object. So, I 
basically want my returned ActionForward to be ignored. How can I do this? Can I 
return null?

I have only used Struts to return jsp pages, previously.

Thanks,
MIke
--
Sent via jApache.org

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




Re: Want ActionForward to be ignored, just using HttpServletResponse

2002-05-29 Thread Jin Bal

Returning null will acheive the effect that you desire

HTH
Jin
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 29, 2002 3:46 PM
Subject: Want ActionForward to be ignored, just using HttpServletResponse


 I have an Action subclass that will be called from an applet. I just need
the Action class to serialize objects to the client using the
HttpServletResponse object. So, I basically want my returned ActionForward
to be ignored. How can I do this? Can I return null?

 I have only used Struts to return jsp pages, previously.

 Thanks,
 MIke
 --
 Sent via jApache.org

 --
 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]




Re: Best way to forward to login, then re-forward to originally requested

2002-05-29 Thread @Basebeans.com

Subject: Re: Best way to forward to login, then re-forward to originally requested
From: Vic C [EMAIL PROTECTED]
 ===
This question should never come up. :-)

It is a bad practice to use Struts or anything for JAAS, other than 
JAAS. The sample Struts app should not be Login.
You should develop a Struts web app. and when done add JAAS.
Look at Servlet 2.2 or 2.3 Java Docs for more on Security.

The short story is it is done for you.

Vic


Charles Brault wrote:
 This question seems to come up frequently, probably should be in a FAQ. 
 Using Servlet Filters is one approach. If you are using Struts 1.1 (in 
 1.0.2 it's slightly different), and want to use a Struts approach, try 
 the following.
 
 I have an application that requires everyone to log in and certain 
 information to be in session before anything else can be done. In order 
 to prevent users from bookmarking a page and jumping into it without 
 having first logged in, I have to check every incoming request for a 
 valid session.
 
 IMHO, the easiest way to do this is to override one or more methods in 
 the RequestProcessor (if you are using Struts 1.1). If you don't have 
 the Struts source you need to obtain it and look at: 
 org.apache.struts.action.RequestProcessor. The processPreprocess method 
 simply returns true on each invocation. However, if you override the 
 original code, and add your own checks, you can filter all the 
 incoming requests for anything that's relevant to your situation.
 
 For example, in the following, we check to see if the incoming request 
 is one of 3 possible pages, returning true if it is, false otherwise. 
 Obviously, you'd need to do other things to handle other types of pages.
 
 public class TDRequestProcessor extends RequestProcessor {
 
protected boolean processPreprocess(HttpServletRequest request,
 HttpServletResponse response) {
 
 
 
 
 String requri =  request.getRequestURI();
 
 // first check the URI, if it's Splash, help  or index.jsp, 
 user is attempting to login
 String path = requri.substring(requri.lastIndexOf(/) + 1);

 if (path.equalsIgnoreCase(splash) || 
 path.equalsIgnoreCase(logon)|| path.equalsIgnoreCase(index.jsp)
 || path.equalsIgnoreCase(logonhelp)) {
 return true;
 }
 
 return false;
 
 }
 
 
 
 }
 
 
 Every request will funnel through this method. So you can check for 
 objects in session and take appropriate forwarding actions if you don't 
 obtain what's expected.
 
 You will need to add the following to the bottom (check the TLD for the 
 exact location) of the struts-config.xml file:
 
 controller
processorClass=com.topdrawer.action.TDRequestProcessor
 /controller
 
 
 



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




Re: Why separate form bean to collect form data?

2002-05-29 Thread @Basebeans.com

Subject: Re: Why separate form bean to collect form data?
From: Vic C [EMAIL PROTECTED]
 ===
Right on JM. MVC, Modular, light weight. That is Struts.
Model should be separate and unit testable.

James Mitchell wrote:
 Hi Norman,
 Yes this is possible, but it defeats (in part) the goals of MVC.  The
 closest thing to what you want may be to use the DynaActionForm class.  That
 way you can just define the field(s) in the struts-config and use then as
 you would any normal ActionForm in your jsp.
 
 James Mitchell
 
 
-Original Message-
From: Ryan Norman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 28, 2002 8:01 PM
To: Struts User Mailing List
Subject: Why separate form bean to collect form data?


Hi,

I am Norman.

Instead of creating a new form bean for each form, can we create a generic
form class that can collect all the data in a form? Using methods in the
request
object through which we can find all the control names and their
values or a
definition that identifies form data to be copied to the generic
form bean,
we eliminate mechanical coding get and set properties for each new form.
Other generic form processing can be added to this form as well.
To further
validate the form, we can extend generic form class for each specific
form.

The intent is to write minimal amount of new code for new application or
function.

Any comments, opinions, criticism?

Thanks

Ryan Norman



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



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




Re: CachedRowSet vs Collection of ValueObject

2002-05-29 Thread @Basebeans.com

Subject: Re: CachedRowSet vs Collection of ValueObject
From: Vic C [EMAIL PROTECTED]
 ===
When people use a the old ResultSet API (instead of the newer RowSet 
API) they need a collection to store rows.

You can avoid creating collecion and the garbage collection and the meta 
data about the collection by using the RowSet's CachedRowSet.

(Also RowSet can be created using new() and not ResultSet, making it 
less likely to leak memory. )

A CachedRowSet is a list of rows.
Why is it so cool and why is it called Cached?
Becuase it is DISCONNECTED.
So after you retrieve, you can disconnect and still access the row. You 
do not need to create a collection.

The reason people used to need a collection is becuase they used to use 
ResultSet which is not a JavaBean and ... it needed to be connected.

Vic


vivek shrivastava wrote:
 Hi,
 
 Following question may sound stupid but this is something I just thought 
 of it.
 
 Can we use a helper class (Let's say HelperDB) which has CachedRowSet 
 as a private member of that helper class instead of using a collection 
 of ValueObject?
 
 I am thinking of using this helper class in EmpForm object of my little 
 application. In EmpAction class i can get a instance of helper class 
 from EmpForm or i can build a instance of helper class in EmpAction 
 class and set it to EmpForm class.
 
 i am also thinking of implementing Iterator interface in helper class so 
 that i can use this class in logic:iterate tag. Like:
 
 logic:iterate id=emp property=HelperDB name=EmpForm
 
 This way i don't have to create a collection of EmpVO (almost duplicate 
 of Empform).
 
 is it a good idea or bad?
 
 Please do comment.
 
 Thanks
 vivek
 
 
 _
 Send and receive Hotmail on your mobile device: http://mobile.msn.com
 
 
 -- 
 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]




Best Struts Code Gen tool

2002-05-29 Thread Sundaram Ramasamy

Hi,

I see list of Struts Code generation tools. But I want to know wich one is
best to generate Action and From Class, struts-config.xml files and  JSP
file.

Also want to access the data from g JBOSS aplication server.

Thanks
-SR



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




RE: CachedRowSet vs Collection of ValueObject

2002-05-29 Thread Chen, Dean (Zhun)

Is CachedRowSet performant?

I read here:
http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html

A CachedRowSet class-a disconnected rowset that caches its data in memory;
not suitable for very large data sets, but an ideal way to provide thin Java
clients, such as a Personal Digital Assistant (PDA) or Network Computer
(NC), with tabular data 

Is this information in the tutorial out of date?

Thanks,

Dean Chen


-Original Message-
From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 11:10 AM
To: [EMAIL PROTECTED]
Subject: Re: CachedRowSet vs Collection of ValueObject


Subject: Re: CachedRowSet vs Collection of ValueObject
From: Vic C [EMAIL PROTECTED]
 ===
When people use a the old ResultSet API (instead of the newer RowSet 
API) they need a collection to store rows.

You can avoid creating collecion and the garbage collection and the meta 
data about the collection by using the RowSet's CachedRowSet.

(Also RowSet can be created using new() and not ResultSet, making it 
less likely to leak memory. )

A CachedRowSet is a list of rows.
Why is it so cool and why is it called Cached?
Becuase it is DISCONNECTED.
So after you retrieve, you can disconnect and still access the row. You 
do not need to create a collection.

The reason people used to need a collection is becuase they used to use 
ResultSet which is not a JavaBean and ... it needed to be connected.

Vic


vivek shrivastava wrote:
 Hi,
 
 Following question may sound stupid but this is something I just thought 
 of it.
 
 Can we use a helper class (Let's say HelperDB) which has CachedRowSet 
 as a private member of that helper class instead of using a collection 
 of ValueObject?
 
 I am thinking of using this helper class in EmpForm object of my little 
 application. In EmpAction class i can get a instance of helper class 
 from EmpForm or i can build a instance of helper class in EmpAction 
 class and set it to EmpForm class.
 
 i am also thinking of implementing Iterator interface in helper class so 
 that i can use this class in logic:iterate tag. Like:
 
 logic:iterate id=emp property=HelperDB name=EmpForm
 
 This way i don't have to create a collection of EmpVO (almost duplicate 
 of Empform).
 
 is it a good idea or bad?
 
 Please do comment.
 
 Thanks
 vivek
 
 
 _
 Send and receive Hotmail on your mobile device: http://mobile.msn.com
 
 
 -- 
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 



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

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




Re: Best Struts Code Gen tool

2002-05-29 Thread James Holmes

The Struts Console is very popular for managing the
Struts config files.  There have been close to 12,000
downloads already.  Synthis’ Adalon software is well
suited to designing Struts-based applications and then
generating code from the design.  Emmanuel Boudrant’s
tools are good for churning out code.

Struts Console:
http://www.jamesholmes.com/struts/

Adalon
http://www.synthis.com/

Emmanuel Boudrant’s Code Generators
www.mycgiserver.com/~eboudrant/

-james
[EMAIL PROTECTED]


--- Sundaram Ramasamy [EMAIL PROTECTED] wrote:
 Hi,
 
 I see list of Struts Code generation tools. But I
 want to know wich one is
 best to generate Action and From Class,
 struts-config.xml files and  JSP
 file.
 
 Also want to access the data from g JBOSS aplication
 server.
 
 Thanks
 -SR
 
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: redirect=true mappings with Websphere 4

2002-05-29 Thread Hertzel Karbasi - OPTinity eBusiness Solutions

Hi

I have encountered the same situation and changed the following lines (See
// Hertzel Tags)
in org.apache.struts.action.RequestProcessor.processActionForward

protected void processActionForward(HttpServletRequest request,
HttpServletResponse response, ActionForward forward) throws IOException,
ServletException {

if (forward == null)
{return;}

/* Hertzel -
When Redirect:
encodeRedirectURL(path) adds the Host,port and ContextPath automatically to
the path. So we do not need to add the ContextPath to path manually!
*/
String path = forward.getPath();

// Hertzel -
String path1 = forward.getPath();

if (forward.getRedirect()) {
if (path.startsWith(/)) {
if (forward.getContextRelative()) {
path = request.getContextPath() + path;
} else {
path = request.getContextPath() + appConfig.getPrefix() + path;
}
}

// Hertzel -
String p1 = response.encodeRedirectURL(path1);

// Hertzel -
// response.sendRedirect(response.encodeRedirectURL(path));
response.sendRedirect(p1);

} else {
if (path.startsWith(/)  !forward.getContextRelative()) {
path = appConfig.getPrefix() + path;
}
doForward( path, request, response);
}
}

Hertzel

- Original Message -
From: Nicolas De Loof [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, May 29, 2002 4:28 PM
Subject: Re: redirect=true mappings with Websphere 4


 same behaviour ...

 
  What happens if you take the slash out of the path? ie path
  =otherAction.do
 
 
 
 
  Nicolas De Loof [EMAIL PROTECTED] on 05/29/2002 06:28:35 AM
 
  Please respond to Struts Users Mailing List
[EMAIL PROTECTED]
 
  To:   Struts Users Mailing List [EMAIL PROTECTED]
  cc:
  Subject:  redirect=true mappings with Websphere 4
 
 
  Hi,
 
  My application (based on Struts 1.0.2) uses the context greco, and I
 have
  some Actions with forward defined like this with a redirect flag :
 
  action   path=/oneAction
type=greco.webapp.MyAction
name=MyForm
scope=request
input=/one.jsp
forward name=success path=/otherAction.do redirect=true/
  /action
 
  On websphere 4.0.2, I get a curious behaviour : When a browser calls
  http://www.myserver.com/greco/oneAction.do
  I'm redirected to
  http://www.myserver.com/greco/greco/otherAction.do  (two times greco)
 
  Did someone notice such context string duplication on redirect ?
  Do you have any solution to avoid it ?
 
  Nico
 
 
 
  --
  To unsubscribe, e-mail:   
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
  mailto:[EMAIL PROTECTED]
 
 
 
 
 
 
  **
  Please Note:
  The information in this E-mail message, and any files transmitted
  with it, is confidential and may be legally privileged.  It is
  intended only for the use of the individual(s) named above.  If you
  are the intended recipient, be aware that your use of any confidential
  or personal information may be restricted by state and federal
  privacy laws.  If you, the reader of this message, are not the
  intended recipient, you are hereby notified that you should not
  further disseminate, distribute, or forward this E-mail message.
  If you have received this E-mail in error, please notify the sender
  and delete the material from any computer.  Thank you.
  **
 
 
 
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


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




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




Re: 'm*n' no of dynamic Text boxes in form Bean ???????

2002-05-29 Thread Jonathan Fuerth

On Thu, May 23, 2002 at 05:10:19PM -0400, Boyalla, Raveendra wrote:
 I have variable no of rows and variable no of columns of text boxes.
 
 So ActionForm should be able to store them in Arrays in Array .
 
 I can not use a simple Array in ActionForm.
 It should be an Arrays in Array.
 Does ActionForm grabs and populate text boxes from Arrays-in-Array type of
 Objects?

Yes, you can do it with Struts by combining indexed and nested
properties on your form.  No additional components are required.  I
worked this code out just now:

in your form class
protected List gridRows;

public void reset(ActionMapping mapping, HttpServletRequest request) {
gridRows=new ArrayList(10);
for(int i=0; i10; i++) {
gridRows.add(new Row(7));
}
}

/** Returns the list of Row objects */
public List getGridRows() {
return gridRows;
}

/** Sets the new list of Row objects */
public void setGridRows(List newGridRows) {
gridRows=newGridRows;
}

/** A class with a single property that the Struts ActionServlet can populate */
public static class Row {
protected List items;
public Row(int length) {
items=new ArrayList(length);
for(int i=0; ilength; i++) {
items.add();
}
}

public List getItems() {
return items;
}

public void setItems(List newItems) {
items=newItems;
}

public int size() {
return items.size();
}
}
---

In your JSP
html:form action=/categoryEditScreen method=get
  bean:define id=form name=categoryForm type=CategoryForm/
  %
int height=form.getGridRows().size();
int width=((CategoryForm.Row)form.getGridRows().get(0)).size();
  %
  table
% for(int y=0; yheight; y++) { %
  tr
% for(int x=0; xwidth; x++) { %
  tdhtml:text property='%= gridRows[+y+].items[+x+] %'//td
% } %
  /tr
% } %
  /table
/html:form
---

Of course, you could use logic:iterate tags if you prefer, but I've
been running into problems on Tomcat 4.0 with Java 1.4 on Solaris,
where the JSP won't compile if there are many JSP custom tags.  Taking
out the iterate tags solves the compilation problem for us without
killing too much readability.

Let me know if you get it working on your end.

-- 
Jonathan Fuerth - SQL Power Group Inc.
(416)218-5551 (Toronto); 1-866-SQL-POWR (Toll-Free)
Unleash the Power of your Corporate Data - http://www.sqlpower.ca/

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




Having a preselected option in dropdown.

2002-05-29 Thread Harjeet Singh

How can I define a pre-selcetd option for the dropdown. I know there should
be a way for it, but try as I migth I am not able to find how.

Could someone provide me a sample peice of code for same.

Thanks in advance.


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




New to Struts

2002-05-29 Thread Vincent Stoessel

Hello,
I have been using forte CE as my main IDE for developing my java and jsp
applications. The concept behind struts sounds great as I want to move 
toward a more standand templates/framework for my web based 
applications. My taglib experience has been very small and my EJB 
experience is still in the book reading phase. Does forte CE
work well with struts or am I better off just using xemecs/jde
to edit files by hand. Thanks.
-- 
Vincent Stoessel
Linux Systems Developer
vincent xaymaca.com


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




RE: New to Struts

2002-05-29 Thread Brad Rhoads

I've been using Forte CE w/ struts 1.0. Works OK, but I haven't gotten the
debugger going yet. And I have the .java  .class files in the same
directories. I know you can set up to compile to different directories, but
I haven't taken the time to figure it out yet.

-Original Message-
From: Vincent Stoessel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 11:08 AM
To: Struts Users
Subject: New to Struts


Hello,
I have been using forte CE as my main IDE for developing my java and jsp
applications. The concept behind struts sounds great as I want to move
toward a more standand templates/framework for my web based
applications. My taglib experience has been very small and my EJB
experience is still in the book reading phase. Does forte CE
work well with struts or am I better off just using xemecs/jde
to edit files by hand. Thanks.
--
Vincent Stoessel
Linux Systems Developer
vincent xaymaca.com


--
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]




RequestProcessor#processRoles

2002-05-29 Thread struts-user

I'm about to invent some kind of user roles scheme, and I notice that RequestProcessor 
has a method named processRoles that runs getRoleNames on the passed 
ActionMapping. ActionMapping (via its ancestor, ActionConfig) stores these roles in a 
property named roles. 

These sound like they address what I'm trying to do. How do I use these features? How 
do I associate roles with a mapping? 

Is this the preferred way to associate URIs with a roles, and roles with users, in 
order to limit access to pages?
--
Sent via jApache.org

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




Re: Design Advice - Relational Databases Java Objects

2002-05-29 Thread Jin Bal

IMHO
It's better that any db access layer does not know how to get a database
connection,  it just gets given them by the client calling it.  This way if
you need to change the way you grab db connections the db access layer is
none the wiser and no code changes are needed

Jin
- Original Message -
From: Adam Hardy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, May 29, 2002 5:44 PM
Subject: Design Advice - Relational Databases  Java Objects


 Hi All,

 I saw this thread in the archives and I thought I'd pinch the title.
 I've spent this afternoon surfing the web looking at stuff on Sun,
 Jakarta  and lots of smaller sites looking for a ready-made data access
 layer package but I take it there isn't an open-source one out there.

 Obviously I don't want to tie my data access layer to struts, so there
 are a few questions I've got.

 (1) Is it best for the data access layer to throw exceptions on error to
 be picked up by the business objects  then struts actions, or would it
 be good to use a struts-type message object and use strings in the
 application resources file (I'm just worried my exceptions' text would
 not be multi-lingual)

 (2) How would I get the database connection info to the data access
 layer? Presuming I want to set it up in struts-config.xml or as in
 commons-dbcp, would I then pass it in from struts actions into the
 business object and then into the data access layer as a parameter on
 each call?



 I've seen quite a few patterns like www.martinfowler.com and code like
 in Sun's Pet Store, so I think I've got a fairly good idea of what I
 need. The data access layer I want has got to:

 - take as input and return as output Data Transport Objects
 - allow the business objects to control transactions
 - use a connection pool
 - possibly keep the SQL statements in an external XML file
 - have comprehensive error handling  reporting




 --
 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]




Re: Help: Problems attempting to migrate to nightly build from 1.0.2

2002-05-29 Thread Dan Rasmussen


For those that may be interested:

As you may recall I was attempting to install the
struts-example webapp on my existing tomcat 3.2.2
deployment (yes, its 3.2.2 rather than 3.2.3) and was
getting class not found errors (for classes that are in
struts.jar).  

How I resolved it: 

Migrated to tomcat 4.0 + jdk 1.4, struts example worked
without a hitch.

The hell I went throught before I decided to got to tomcat
4: 
Mystified after days of thrashing, I happened to try
renaming the WEB-INF directory to web-inf and all my
startup problems went away (though I had a host of new
problems due to hard-coded paths that went through
WEB-INF).

For some reason, tomcat 3.2.2 on linux can't find the
struts-example required jar files unless they are in a
directory named web-inf/lib rather than WEB-INF/lib. 
This is when I decided it was time to move to tomcat 4.

Thanks.

Dan Rasmussen


--- Dan Rasmussen [EMAIL PROTECTED] wrote:
 
 Hi,
 
 We have been using Struts 1.0.2 for a while now without
 problem.  Recently I decided I wanted to try the indexed
 tag for forms and found that I needed to use the nightly
 build to get this feature.
 
 I have attempted to install the nightly build in my
 application and ran into all sorts of problems that began
 with this message when I restart tomcat:
 
 MessageResourcesFactory.createFactory
 java.lang.ClassNotFoundException:
 org.apache.struts.util.PropertyMessageResourcesFactory
 
 So I tried installing the struts-example war file by
 dropping it into my existing tomcat deployment and get
 the
 same error.  
 
 I tried moving struts jar files around (like into the
 $TOMCAT_HOME/lib directory) but there is nothing but
 worms
 in that can.  
 
 Deployment details:
 
 Tomcat 3.2.3 (or is it 3.2.2?)
 Linux 2.4.7-10
 jdk 1.3.1_03
 
 I also tried the struts-example on a similarly configured
 win nt box and get the same ClassNotFoundException.
 
 I also need to move th jdk 1.4 and tomcat 4.  Should I do
 that migration first?
 
 Any suggestions greatly appreciated.
 
 Thanks.
 
 Dan Rasmussen
 
 
 =
 -- replies to [EMAIL PROTECTED] --
 
 Anything that appears after this sentence is inserted by 
 Yahoo (or others) and may not be a good idea.
 
 __
 Do You Yahoo!?
 LAUNCH - Your Yahoo! Music Experience
 http://launch.yahoo.com
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 



=
-- replies to [EMAIL PROTECTED] --

Anything that appears after this sentence is inserted by 
Yahoo (or others) and may not be a good idea.

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




RE: Design Advice - Relational Databases Java Objects

2002-05-29 Thread Jerome Jacobsen

Have you looked at these opensource projects?

JBoss http://www.jboss.org/
OpenEJB http://www.openejb.org/
Castor JDO http://castor.exolab.org/
ObjectRelationalBridge http://objectbridge.sourceforge.net/

As for (1) I would have the business objects throw exceptions.  I would have
the Struts Action convert exceptions to ActionErrors or ActionMessages as
appropriate.

As for (2) the answer depends on the capabilities of the data-access layer
you are using.

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 12:44 PM
To: Struts Users Mailing List
Subject: Design Advice - Relational Databases  Java Objects


Hi All,

I saw this thread in the archives and I thought I'd pinch the title.
I've spent this afternoon surfing the web looking at stuff on Sun,
Jakarta  and lots of smaller sites looking for a ready-made data access
layer package but I take it there isn't an open-source one out there.

Obviously I don't want to tie my data access layer to struts, so there
are a few questions I've got.

(1) Is it best for the data access layer to throw exceptions on error to
be picked up by the business objects  then struts actions, or would it
be good to use a struts-type message object and use strings in the
application resources file (I'm just worried my exceptions' text would
not be multi-lingual)

(2) How would I get the database connection info to the data access
layer? Presuming I want to set it up in struts-config.xml or as in
commons-dbcp, would I then pass it in from struts actions into the
business object and then into the data access layer as a parameter on
each call?



I've seen quite a few patterns like www.martinfowler.com and code like
in Sun's Pet Store, so I think I've got a fairly good idea of what I
need. The data access layer I want has got to:

- take as input and return as output Data Transport Objects
- allow the business objects to control transactions
- use a connection pool
- possibly keep the SQL statements in an external XML file
- have comprehensive error handling  reporting




--
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]




Re: New to Struts

2002-05-29 Thread James Holmes

Forte CE and NetBeans are good tools for working with
Struts.  Currently the Struts Console plugs into both
of the IDEs.

Struts Console:
http://www.jamesholmes.com/struts/

I'm working with some folks at Sun to bring better
Struts support into both of these IDEs. This should
add alot of needed development support tools.

-james
[EMAIL PROTECTED]

--- Vincent Stoessel [EMAIL PROTECTED] wrote:
 Hello,
 I have been using forte CE as my main IDE for
 developing my java and jsp
 applications. The concept behind struts sounds great
 as I want to move 
 toward a more standand templates/framework for my
 web based 
 applications. My taglib experience has been very
 small and my EJB 
 experience is still in the book reading phase. Does
 forte CE
 work well with struts or am I better off just using
 xemecs/jde
 to edit files by hand. Thanks.
 -- 
 Vincent Stoessel
 Linux Systems Developer
 vincent xaymaca.com
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




logic:iterate and multiple selections

2002-05-29 Thread Dan Rasmussen


Hi All,

I have an existing application that uses the logic:iterate
tag to display a table of editable/deletable elements
based on a collection of beans.  I have been tasked with
adding checkboxes to each row so that multiple selections
can be made and operated on (e.g. delete multiple elements
simultaneously rather than have to individually delete an
element).  

Is there a good example of this sort of thing somewhere? 
Short of that, am I on the right path in the assumption
that its the Indexed attribute that will be part of my
answer?  I was hoping the nightly build might have a good
example of how to use the indexed tag but I can't seem to
find any example of the use of the indexed tag in the
sample webapps shipped with it.

Any help greatly appreciated.

Thanks.

Dan Rasmussen


=
-- replies to [EMAIL PROTECTED] --

Anything that appears after this sentence is inserted by 
Yahoo (or others) and may not be a good idea.

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: New to Struts

2002-05-29 Thread James Holmes

The functionality should be available to both Forte
and NetBeans since both are built on the same
foundation.  Basically we are working on a Struts
Support module that has tighter integration of Struts
Console into the IDEs as well as other functionality.

Once things are working you'll be able to get the
module and updates for it through the Update Center
functionality built into both IDEs.

I'm not sure what the time frame is at this point as
that is dictated by Sun.

-james
[EMAIL PROTECTED]
http://www.jamesholmes.com/struts/


--- [EMAIL PROTECTED] wrote:
 
 
 I'm working with some folks at Sun to bring better
 Struts support into both of these IDEs. This should
 add alot of needed development support tools.
 
 Just curious about this...
 
 I assume that this would available as a plugin as
 well?
 
 long shot
 
 How soon would we see this type of thing for Forte?
 
 Thanks.
 
 
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




Re: New to Struts

2002-05-29 Thread Jeff_Mychasiw



Thanks James,

maybe I will throw this question on the Forte List... just for fun. :)




James Holmes [EMAIL PROTECTED] on 05/29/2002 12:15:55 PM

Please respond to Struts Users Mailing List [EMAIL PROTECTED]

To:   Struts Users Mailing List [EMAIL PROTECTED]
cc:

Subject:  Re: New to Struts


The functionality should be available to both Forte
and NetBeans since both are built on the same
foundation.  Basically we are working on a Struts
Support module that has tighter integration of Struts
Console into the IDEs as well as other functionality.

Once things are working you'll be able to get the
module and updates for it through the Update Center
functionality built into both IDEs.

I'm not sure what the time frame is at this point as
that is dictated by Sun.

-james
[EMAIL PROTECTED]
http://www.jamesholmes.com/struts/


--- [EMAIL PROTECTED] wrote:


 I'm working with some folks at Sun to bring better
 Struts support into both of these IDEs. This should
 add alot of needed development support tools.

 Just curious about this...

 I assume that this would available as a plugin as
 well?

 long shot

 How soon would we see this type of thing for Forte?

 Thanks.



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



__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
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]




RE: Having a preselected option in dropdown.

2002-05-29 Thread Sri Sankaran

Of course your 'optionValues' collection must have an item called 'Item 2'.

BTW: The form bean 'selectedItem' value should read 'Item 2'.

Sri

-Original Message-
From: Sri Sankaran 
Sent: Wednesday, May 29, 2002 1:19 PM
To: 'Struts Users Mailing List'
Subject: RE: Having a preselected option in dropdown.


-- JSP Code --

html:select property=selectedItem size=10
html:options name=optionValues labelName=optionValues/ /html:select

-- Form Bean --

String selectedItem = Single 2;


This will result in a drop-down with 'Item 2' selected.

Hope that helps

Sri

-Original Message-
From: Harjeet Singh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 12:07 PM
To: [EMAIL PROTECTED]
Subject: Having a preselected option in dropdown.


How can I define a pre-selcetd option for the dropdown. I know there should
be a way for it, but try as I migth I am not able to find how.

Could someone provide me a sample peice of code for same.

Thanks in advance.


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

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

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




Cookies not being written using Form-Based Authentication

2002-05-29 Thread Roland Chan

Hello,
 
When using form based authentication, it appears that cookies are not
being written to the client.  In my server.xml, noCookies=false, and the
client browsers have cookies enabled.
 
Can anyone shed any light here?
 
Thanks,
Roland
 



Struts 1.0.2 with weblogic 5.1

2002-05-29 Thread Deepa Matta


Hi
I am trying to configure struts 1.0.2 with weblogic 5.1 service pack 9. I 
have an webapp called presentation which contains many jsp files. The 
weblogic.properties file has a weblogic.httpd.documentRoot=./presentation/
setting which allows pages to be loaded without putting presentation in the 
path e.g I can type http://localhost/login.jsp to load the page.

In order to make the current setup work with struts, i created a WEB-INF 
directory and put all the required files in it. I created a helloworld.jsp 
which uses the bean:message tag of struts.
I added
weblogic.httpd.webApp.presentation=./presentation/
to the weblogic properties file.

The problem is if I load helloworld.jsp using the url 
http://localhost/helloworld.jsp, I get the following exception

Wed May 29 11:52:32 MDT 2002:E ServletContext-General Root cause of 
ServletException javax.servlet.jsp.JspException: Cannot find message 
resources under key org.apache.struts.action.MESSAGE
at 
org.apache.struts.util.RequestUtils.message(RequestUtils.java:568)
at 
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:239)
at com.ereinsure.jsp._helloworld._jspService(_helloworld.java:83)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
at 
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
at 
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
at 
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at 
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
at 
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)

however if i load it using the url 
http://localhost/presentation/helloworld.jsp then it works fine.

I am trying to use the struts framework for an existing application and 
would prefer to make it work without having to put presentation in the url 
because this is the only web application and its the default.
Is there a property in struts that i can set or in weblogic that would 
enable http://localhost/helloworld.jsp to work.

I am new to struts and would really appreciate any comment or help on this.

thanks,

Deepa.

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Multiple struts applications

2002-05-29 Thread wbchmura


What would be the best way to:

* Have a user bean shared across the entire app-server?  Log-in and it 
knows you no matter which web-app you access on the server (it will not 
need to be handled across multiple servers).

* Provide consistant look and feel across all the applications easily (I 
am looking at tiles, so can I make one application read in header.jsp 
from another web-app container (or just some common area)?

This is all going to be on an Intranet with a limited number of 
employees.  

In the big picture I am trying to decide if I should make it all in one 
web-app and just define different packages for each application, or in 
different web-app containers and make it span like I mentioned above...

Any help would be greatly appreciated!

Bill



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




Re: New to Struts

2002-05-29 Thread Vincent Stoessel

Truly cool, it's running sweet in forte 3.0 CE.

OK, time for the slow part, reading the struts docs.
:)

Thank You



James Holmes wrote:
 Forte CE and NetBeans are good tools for working with
 Struts.  Currently the Struts Console plugs into both
 of the IDEs.
 
 Struts Console:
 http://www.jamesholmes.com/struts/
 
 I'm working with some folks at Sun to bring better
 Struts support into both of these IDEs. This should
 add alot of needed development support tools.
 






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

 
 
 __
 Do You Yahoo!?
 Yahoo! - Official partner of 2002 FIFA World Cup
 http://fifaworldcup.yahoo.com
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]



-- 
Vincent Stoessel
Linux Systems Developer
vincent xaymaca.com


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




Auto-populate text

2002-05-29 Thread Troy Spruit

I'm having an issue with getting an html:textarea to autofill when I
forward to the page it is on. I basically have a preview and accept
button on my page. When the user presses either button the form submits
to the same location but if I see the preview request attribute I
forward back to the page it was coming from. When it comes back the text
areas are blank. Does anyone know what needs to be in place for the
textarea to re-populate?

 

Thanks, Troy




RE: Multiple struts applications - dang?

2002-05-29 Thread wbchmura


Okay, I ran across a write-up on jGuru that tells me I cannot do the 
second one... Does anyone have a good idea for handling this?  I was 
thinking maybe an ant build that would copy all of the central templates 
to all of the web-apps that used them...  That would provide a central 
place to maintain them...  Thoughts?

forget the first one, I forgot about Tomcats built in realms and 
form-based-logins...

Thanks!

Bill



-Original Message-
From: William B. Chmura 
Sent: Wednesday, May 29, 2002 2:27 PM
To: struts-user
Subject: Multiple struts applications



What would be the best way to:

* Have a user bean shared across the entire app-server?  Log-in and it 
knows you no matter which web-app you access on the server (it will not 
need to be handled across multiple servers).

* Provide consistant look and feel across all the applications easily (I 

am looking at tiles, so can I make one application read in header.jsp 
from another web-app container (or just some common area)?

This is all going to be on an Intranet with a limited number of 
employees.  

In the big picture I am trying to decide if I should make it all in one 
web-app and just define different packages for each application, or in 
different web-app containers and make it span like I mentioned above...

Any help would be greatly appreciated!

Bill



--
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]




Re: Help with JDBC Connection Pool

2002-05-29 Thread @Basebeans.com

Subject: Re: Help with JDBC Connection Pool
From: Ken Holzer [EMAIL PROTECTED]
 ===
I tried to implant the info Mark had sent and when I start my server I get
the following error:

Is there something I need to do in the ActionServlet?

I am using the jakarta-struts-20020529 build.

Thanks,

Ken
[02.05.29 14:00:18:109 CDT] 55a6519c WebGroup I SRVE0091I: [Servlet LOG]:
action: init

java.lang.NullPointerException

at java.util.Hashtable.put(Hashtable.java(Compiled Code))

at org.apache.commons.dbcp.BasicDataSource.createDataSource(Unknown Source)

at org.apache.commons.dbcp.BasicDataSource.setLogWriter(Unknown Source)

at
org.apache.struts.action.ActionServlet.initApplicationDataSources(ActionServ
let.java:884)

at org.apache.struts.action.ActionServlet.init(ActionServlet.java:420)

at javax.servlet.GenericServlet.init(GenericServlet.java:258)

at
com.ibm.servlet.engine.webapp.StrictServletInstance.doInit(ServletManager.ja
va:802)

at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._init(StrictLifecycleSe
rvlet.java:137)

at
com.ibm.servlet.engine.webapp.PreInitializedServletState.init(StrictLifecycl
eServlet.java:243)

at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.init(StrictLifecycleSer
vlet.java:103)

at
com.ibm.servlet.engine.webapp.ServletInstance.init(ServletManager.java:388)

at javax.servlet.GenericServlet.init(GenericServlet.java:258)

at
com.ibm.servlet.engine.webapp.ServletManager.addServlet(ServletManager.java:
84)

at
com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(WebAppServlet
Manager.java:226)

at
com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets(WebA
ppServletManager.java:357)

at com.ibm.servlet.engine.webapp.WebApp.loadServletManager(WebApp.java:1001)

at com.ibm.servlet.engine.webapp.WebApp.init(WebApp.java:133)

at com.ibm.servlet.engine.srt.WebGroup.loadWebApp(WebGroup.java:234)

at com.ibm.servlet.engine.srt.WebGroup.init(WebGroup.java:139)

at
com.ibm.servlet.engine.ServletEngine.addWebApplication(ServletEngine.java:63
3)

at com.ibm.ws.runtime.WebContainer.install(WebContainer.java:36)

at com.ibm.ws.runtime.Server.startModule(Server.java:615)

at
com.ibm.ws.runtime.StandardServer.initializeModules(StandardServer.java:333)

at
com.ibm.ws.runtime.StandardServer.initializeRuntime0(StandardServer.java:349
)

at com.ibm.ws.runtime.Server.initializeRuntime(Server.java:882)

at com.ibm.ws.runtime.StandardServer.main(StandardServer.java:519)

at java.lang.reflect.Method.invoke(Native Method)

at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:158)

at
com.ibm.etools.websphere.tools.runner.api.ServerRunner$1.run(ServerRunner.ja
va)

Mark Johnson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 [EMAIL PROTECTED] wrote:
 Mark,
 Can you post it or send it to me as well. I am looking for examples to do
that as well. Thanks much.
 
 Regards,
 
 Muki Soomar
 

 Here it is:
 begin struts-config.xml fragment**
 ?xml version=1.0 encoding=ISO-8859-1 ?

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

 struts-config

   !-- == Data Sources == --
data-sources

   data-source className=org.apache.struts.config.DataSourceConfig
key=MyData
type=org.apache.commons.dbcp.BasicDataSource

  set-property property=driverClassName
value=org.postgresql.Driver/
  set-property property=maxActive
value=4/
  set-property property=password
value=my_postgres_password/
  set-property property=url
value=jdbc:postgresql:mydata/
  set-property property=username
value=my_postgres_username/

   /data-source

/data-sources
 end struts-config.xml fragment
 ***begin overridden ActionForward.execute fragment***
 HttpSession session = request.getSession();
 BasicDataSource ds = (BasicDataSource)
 session.getServletContext().getAttribute(MyData);
 Connection conn = null;
 PreparedStatement prpd_st = null;
 ResultSet res = null;
 try {
   conn = ds.getConnection();
 ***end overridden ActionForward.execute fragment*
 *files you need in WEB-INF/lib that might not be there*
 $ ls -l WEB-INF/lib
 -rw-r--r--1 markjmarkj  107105 May 21 11:37
commons-collections.jar
 -rw-r--r--1 markjmarkj   35870 May 21 11:37 commons-dbcp.jar
 -rw-r--r--1 markjmarkj   28840 May 21 11:37 commons-pool.jar
 -rw-r--r--1 markjmarkj6727 May 21 11:37 jdbc2_0-stdext.jar
 -rw-r--r--1 markjmarkj  116204 May 10 14:26 pgjdbc2.jar
 ...
 ***end files you need in WEB-INF/lib that might not be there***
 
 -Original Message-
 From: Mark Johnson [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 22

RE: Auto-populate text

2002-05-29 Thread James Mitchell

It sounds like whatever field you are using in the html:textarea to populate
the control is not retaining the data.

Is whatever action(call it action1) forwarding the first time populating the
bean?
Is the text hard-coded, in the resources file, or done at runtime?

Since the bean is repopulated at each request, make sure that the second
action(call it action2) that is forwarding to the jsp is also populating
your bean the same way action1 is.

Hope that helps!
James Mitchell

 -Original Message-
 From: Troy Spruit [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 29, 2002 2:50 PM
 To: Struts Users Mailing List
 Subject: Auto-populate text


 I'm having an issue with getting an html:textarea to autofill when I
 forward to the page it is on. I basically have a preview and accept
 button on my page. When the user presses either button the form submits
 to the same location but if I see the preview request attribute I
 forward back to the page it was coming from. When it comes back the text
 areas are blank. Does anyone know what needs to be in place for the
 textarea to re-populate?



 Thanks, Troy




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




RE: Repopulating data between forms.

2002-05-29 Thread Andrew van der Voort

Thanks, that seems to work - though only if the names of the attributes in
the HTML are the same. I thought that if the names of attributes on the two
ActionForm instances - even if they were different classes (as in my case
for the list and modify pages) - were the same, struts would know where I
was coming from and where I was going to and copy the attributes.

But I guess in hindsight it makes sense for struts to concern itself only
with what gets submitted with the form.

Thanks, Andrew

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 29 May 2002 4:34 a.m.
To: Struts Users Mailing List
Subject: Re: Repopulating data between forms.


It's a whole new request after the page renders since that 
completes the
request/response cycle. But the part where an ActionForward sends you
back to the list page should be part of the same request/response.
Unless redirect has been set to true, in which case a response is sent
out to the browser telling it to make a new request. 

If the same ActionForm is being used all-around, it should still be in
the request context when you forward back to the page. If the 
ActionForm
property that is holding the selected staff type matches the element on
the HTML form, and the html tags are being used, then it should be
selected. 

I'd start by forcing validation to fail to see if it stays selected
then. The roundtrip from validation back to the page should be the same
as the roundtrip from the Action back to the page. 

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services


It sounds like that 

Andrew van der Voort wrote:
 
 I have a list page, that can display different categories of 
staff. In the
 form that supports the page I have a Collection of staff 
types, and an
 attribute that holds the selected staff type.
 
 One of the actions that can be performed from this page is 
to edit one of
 the displayed staff. In the form that supports this edit 
action, I also
 have an attribute that holds the selected staff type from 
the list page.
 This gets automatically populated for me, since the staff 
type is submitted
 with the page.
 
 When the user is done editing the staff members details, I return an
 ActionForward that sends me back to the list page. What I 
want is that role
 type to be automatically populated back into the list form, 
so that the
 list is displayed with staff of the type that were there 
when the user went
 to edit one.
 
 This isn't happening for me. What are the steps I need to do 
to get this to
 happen? I'd like to avoid creating hidden fields on the html 
page. I've
 tried request.setAttribute but this doesn't seem to work 
(which makes sense
 because it's a whole new request when you leave the action, right?).
 
 Thanks,
 
 Andrew
 
 --
 To unsubscribe, e-mail:   
mailto:struts-user-[EMAIL PROTECTED]
 For 
additional commands, 
e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   
mailto:struts-user-[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]




Nested menu item

2002-05-29 Thread Trieu, Danny

Cedric,

is there anyway to define nested menu items( meaning submenu) inside the
definition.xml file?

thanks

danny

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




Data type handling

2002-05-29 Thread Will Spies/Towers Perrin



We have cases where some of our data elements in our ActionForms are not
native Java types. We have Date and Timestamp elements. Seems struts does
not handle these data types as part of the conversion from a post to an
ActionForm? Also, we would prefer to be able to post a Double value contain
commands ( e.g. 37,000.34 ) as opposed to to having no commands ( e.g.
37000.34 works fine ).

Any suggestions?


___
Will Spies
Towers Perrin
Phone: (215)246-7145
e-mail: [EMAIL PROTECTED]


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




A common problem: Cannot find ActionMappings or ActionFormBeans?

2002-05-29 Thread @Basebeans.com

Subject: A common problem: Cannot find ActionMappings or ActionFormBeans?
From: Jesper Lindholt Ottosen [EMAIL PROTECTED]
 ===
This is a multi-part message in MIME format.
--71050682FAF314ABBDC2DF31
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi!

I have been attacking the Cannot find ActionMappings or ActionFormBeans
problem in a specific web app for quite some nights now. I have searched
for answers on the 'net and in this newsgroup, and checked up on most of
the advices. Apparently I'm not alone (and that's a comfort, after all :).

Question 1: How come the struts-config.xml file is so vulnerable and
what is done to make it more robust? To me it seems that there is a lot 
of suggestions on why the problem arises, but they are very different, 
with no general applicability. Is there perhaps a solution that verifies 
the file and setup properties (A Do this and it can't go wrong)?

Back to my current problem: My Linux (7.2) crashed with two projects
that worked - I managed to save the files and have been rebuilding the
setup with Tomcat 4.0.2, Struts 1.0.2 and various XML parsers. 
Now one project works fine, the other project simply gives me the problem
no matter what I try.. I tried removing these XML jar's from the $CLASSPATH 
but it didn't matter. My project needs a JDOM xml-parser so that and the 
struts.jar file is added to the project WEB-INF/lib. I tried building
the app' up from scratch based on struts-blank, with no luck at all (!).

Question 2: The struts-config.xml file I use (attached) generates a 
parsing error in the log and the dreaded JSP exception error page, when 
I start my application from a JSP page containing:
...
html:form action=login.do focus=login
...
/html:form
...
Can anyone find the blind spot I've been missing? I'm pretty sure that the 
files and the system setup (including web.xml) is as before the crash, and 
the jsp-files etc are all in the right places. But let me know if you want
any of them.

Any help will be appreciated - thanks!


-- 
Jesper
-- [EMAIL PROTECTED] - Computer Science ---
-- www.o2sn.dk/jesper - Aarhus University --
--71050682FAF314ABBDC2DF31
Content-Type: text/xml; charset=us-ascii;
 name=struts-config.xml
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename=struts-config.xml

?xml version=1.0 encoding=ISO-8859-1 ?
!-- $Id: struts-config.xml,v 1.10 2002/04/27 11:40:39 jesper Exp $ --
!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

struts-config

  form-beans type=org.apache.struts.action.ActionFormBean
form-bean  name=anyForm type=myApplication.anyForm /
  /form-beans

  global-forwards type=org.apache.struts.action.ActionForward
forward name=login path=/login.jsp /
forward name=menu path=/menu.jsp / 
forward name=hej path=/hej.jsp / 
forward name=kig path=/kig.jsp / 
forward name=exit path=/logout.jsp / 
  /global-forwards

  action-mappings type=org.apache.struts.action.ActionMapping
action path=/login 
type=myApplication.loginAction
name=anyForm 
unknown=true
scope=request 
validate=true
input=/login.jsp
/action
action path=/logout 
type=myApplication.logoutAction
name=anyForm 
scope=request 
validate=false
input=/logout.jsp
/action
action path=/hej 
type=myApplication.hejAction
name=anyForm 
scope=request 
validate=false
input=/hej.jsp
/action
action path=/kig 
type=myApplication.kigAction
name=anyForm 
scope=request 
validate=false
input=/kig.jsp
/action
  /action-mappings

/struts-config

--71050682FAF314ABBDC2DF31--


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




RE: Websphere 4.02 Struts Deployment

2002-05-29 Thread Benson, Mike


Hello, I'm working on deploying to Websphere 4.x on the Win 2000 platform,
and I'm receiving the following error:

Error 500: Cannot find ActionMappings or ActionFormBeans collection 

I've read a few emails about modifying the struts code to make this work and
replacing parsers and all, but my dilemma is that I've got to deploy this to
Websphere 4.x on OS/390 when I'm done with 2000.  Is there a more simple
solution or anyplace that describes the changes in a little more detail that
you can point me in the right direction?  

Thanks in advance,

Mike Benson


 -Original Message-
 From: Danny Mui [SMTP:[EMAIL PROTECTED]]
 Sent: Wednesday, May 15, 2002 12:04 PM
 To:   Struts Users Mailing List
 Subject:  Re: Websphere 4.02 Struts Deployment
 
 To follow up,
 
 WebSphere 4.02 comes with the fix pack (they also have an E-FIX for
 putting
 out that fire) that makes it redirect compliant to servlet spec 2.3.  To
 enable this mode, add :
 
 name com.ibm.websphere.sendredirect.compliance
 value 1
 
 to the System Properties in the admin console under: Application Servers
 \[DefaultServer] \ JVM Settings
 
 I should have checked the Dev list :)
 
 thanks again
 
 - Original Message -
 From: Tero P Paananen [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Tuesday, May 14, 2002 7:50 PM
 Subject: RE: Websphere 4.02 Struts Deployment
 
 
   I'm having problems with struts forwards:
  
   logic:redirect forward=summary /
  
   (forwards to /do/summary/display)
  
   it actually redirects it to : /app/app/do/summary/display
  
   I think Websphere is being too helpful here with the redirects!!  Any
   pointers?
 
  There's a patch to this bug.
 
  I'll dig it up for you tomorrow morning, if you'd
  kindly remind me by Email.
 
  -TPP - it's past my bed time
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

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




getServlet()?

2002-05-29 Thread Geoffrey Corb

I have been attempting to update a project from Struts 1.0 to 1.0.2 to
resolve some file upload problems.  Now, I've found that the ActionForm's
getServlet() method no longer exposes the ActionServlet.  This is especially
problematic to me, since a fair number of our ActionForm-derived classes use
the ActionServlet to get at the ServletContext in their validation scripts.
Is there a workaround possible?  I'm trying to retrieve initialization
parameters from the ServletContext in the validate() methods of my
ActionForm-derived classes.
 
Another question:  What good is the ActionServletWrapper when it *barely*
wraps the ActionServlet class?  I understand wanting to prevent public
String properties of ActionServlet from being changed via a query string
(quoted from release notes), but why not provide access to other, relatively
important, methods, like getServletContext()?
 
- G. Corb
 
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. When
addressed to our clients any opinions or advice contained in this email are
subject to the terms and conditions expressed in the governing Synergenic
client Agreement.



Prefix Matching

2002-05-29 Thread Martin Samm

i've hcecked the archives and found no answer so here goes.

We're designing a new app which will display a variety of categories of 
content. Essentially a request to display a content type will have a URL of

www.mayapplication.com/do/content/CONTENTTYPE/id.jsp

Can we support this with a combination of servlet mappings ( map /do/* to and 
use the action servlet) and ActionMappings (/do/content/* use a particular 
action?). If i can generalise 
www.mayapplication.com/do/content/CONTENTTYPE/id.jsp to use on action then i 
can split the request string up and find the terms afer /do/content/

Any ideas?
-- 
Martin Samm
[EMAIL PROTECTED]

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




forward to Action from perform of Action

2002-05-29 Thread Alexandar

If I have an action that will need to forward to a different business action
under certain circumstances, how should I do that?  Tried forwarding to the
path of another Action, but that's not obviously correct (based upon the
errors I'm getting).

thx...


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




RE: Use of custom convertors

2002-05-29 Thread Byrne, Steven

Shouldn't this be modified to be all accessed NON-CHECKBOX
properties...?  From doing some tests with String properties
representing checkbox values, as long as you either default the checkbox
value, or it's set to one of on, yes, or true then you're ok, but
should you
set the value explicitly:

html:checkbox property=testCheck value=testing/

you will lose if you display the checkbox on a subsequent page, even if
you specify the
value as testing, because the logic which decides to emit the
checked input attribute
only looks for on, yes, or true; anything else is false.

Steve

 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 28, 2002 8:18 PM
 To: Struts Users Mailing List
 Subject: RE: Use of custom convertors
 
 
 I think that what Jerome meant is all accessed 
 propertiesmeaning if
 nested or even recursively nested, the same applies.  the getXXX() and
 setXXX() should always be String.
 
 James Mitchell
 
  -Original Message-
  From: Don Saxton [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, May 28, 2002 10:49 PM
  To: Struts Users Mailing List; [EMAIL PROTECTED]
  Subject: Re: Use of custom convertors
 
 
  Actually I don't think that is sufficient. Consider an 
 object which is a
  recursive tree.
 
  - Original Message -
  From: Jerome Jacobsen [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Tuesday, May 28, 2002 10:25 AM
  Subject: RE: Use of custom convertors
 
 
   The best practice for form beans is that all properties 
 be Strings.
  Your
   Action can do the conversion both ways.  For the request 
 it converts the
   String to the type expected by the business object.  For 
 the response it
   converts the business object's type to the String to be 
 set on the form
   bean.  BeanUtils can be used by the Action to do both types of
  conversion.
  
  
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, May 28, 2002 1:10 PM
   To: Struts Users Mailing List
   Subject: Re: Use of custom convertors
  
  
  
   Ok I may be missing something as I am brand new to 
 struts. Why would we
  not
   want to use the same mechanism for getting properties 
 as we do for
   setting properties? Why wouldn't the framework determine the
  type of the
   source and call the appropriate converter in order to create the
   appropriate string representation for display?
  
   Thanks.
  
   Keith Nielsen
  
  
  
  
  
   Ted Husted
   husted@apachTo: Struts Users
  Mailing List
   [EMAIL PROTECTED]
   e.org   cc:
Subject: Re: 
 Use of custom
   convertors
   05/28/2002
   10:23 AM
   Please
   respond to
   Struts Users
   Mailing List
  
  
  
  
  
  
   Personally, I'd do the conversions in the JavaBean and 
 leave the tags
   out of it.
  
   -- Ted Husted, Husted dot Com, Fairport NY US
   -- Developing Java Web Applications with Struts
   -- Tel: +1 585 737-3463
   -- Web: http://husted.com/about/services
  
   [EMAIL PROTECTED] wrote:
   
I am writing custom converters which BeanUtils will use to do
  conversions
from request data to form bean. It appears however that 
 on the return
   path
that none of the tags actually use BeanUtils, and as 
 such my converter
  is
only used in one direction. Is my understanding of this 
 correct? If so
   how
do I avoid having to rip apart my nested beans in order 
 to get right
conversions on the subsequent generation of the next page.
   
Thanks.
   
Keith
   
--
To unsubscribe, e-mail:   
   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
   mailto:[EMAIL PROTECTED]
  
   --
   To unsubscribe, e-mail:   
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail: 
   mailto:[EMAIL PROTECTED]
  
  
  
  
  
  
   --
   To unsubscribe, e-mail:
   mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
   mailto:[EMAIL PROTECTED]
  
  
  
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
 
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 

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




request scope error

2002-05-29 Thread Mike Rose - Sun Microsystems

has anyone seen this error when using struts html:form 
tag with iws 4.1??

javax.servlet.ServletException: cant remove Attributes from request scope

thanks
Mike


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




RE: forward to Action from perform of Action

2002-05-29 Thread Galbreath, Mark

That's exactly how you do it; you must be doing something wrong in
struts-config.  but this subject has been brought up and answered many times
recently.  Did you check the archive?

http://www.mail-archive.com/struts-user%40jakarta.apache.org/

Mark

-Original Message-
From: Alexandar [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 12:55 PM

If I have an action that will need to forward to a different business action
under certain circumstances, how should I do that?  Tried forwarding to the
path of another Action, but that's not obviously correct (based upon the
errors I'm getting).

thx...

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




Re: logic:iterate and multiple selections

2002-05-29 Thread Arron Bates

Indexed options in the tag is one way to get it done, but it's not the 
easiest.

Here's a previous post where I put up a quick example of doing without 
nested tags, and with the nested tags...

http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg31991.html

And if you have Struts 1.1b, then you already have the nested tags.


Running example of delete/add functionality using the nested tags...
http://www.keyboardmonkey.com/StrutMonkey/MonkeyStruts_v2.jsp

Primer and tutorials on the tags are here...
http://www.keyboardmonkey.com/next

For older Struts versions the above site has the jar of just the tags.


Arron.


Dan Rasmussen wrote:

Hi All,

I have an existing application that uses the logic:iterate
tag to display a table of editable/deletable elements
based on a collection of beans.  I have been tasked with
adding checkboxes to each row so that multiple selections
can be made and operated on (e.g. delete multiple elements
simultaneously rather than have to individually delete an
element).  

Is there a good example of this sort of thing somewhere? 
Short of that, am I on the right path in the assumption
that its the Indexed attribute that will be part of my
answer?  I was hoping the nightly build might have a good
example of how to use the indexed tag but I can't seem to
find any example of the use of the indexed tag in the
sample webapps shipped with it.

Any help greatly appreciated.

Thanks.

Dan Rasmussen


=
-- replies to [EMAIL PROTECTED] --

Anything that appears after this sentence is inserted by 
Yahoo (or others) and may not be a good idea.

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
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]




Re: CachedRowSet vs Collection of ValueObject

2002-05-29 Thread @Basebeans.com

Subject: Re: CachedRowSet vs Collection of ValueObject
From: Vic C [EMAIL PROTECTED]
 ===
It is very fast, besides you are using CRS only as a collection.


Chen, Dean (Zhun) wrote:
 Is CachedRowSet performant?
 
 I read here:
 http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html
 
 A CachedRowSet class-a disconnected rowset that caches its data in memory;
 not suitable for very large data sets, but an ideal way to provide thin Java
 clients, such as a Personal Digital Assistant (PDA) or Network Computer
 (NC), with tabular data 
 
 Is this information in the tutorial out of date?
 
 Thanks,
 
 Dean Chen
 
 
 -Original Message-
 From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 29, 2002 11:10 AM
 To: [EMAIL PROTECTED]
 Subject: Re: CachedRowSet vs Collection of ValueObject
 
 
 Subject: Re: CachedRowSet vs Collection of ValueObject
 From: Vic C [EMAIL PROTECTED]
  ===
 When people use a the old ResultSet API (instead of the newer RowSet 
 API) they need a collection to store rows.
 
 You can avoid creating collecion and the garbage collection and the meta 
 data about the collection by using the RowSet's CachedRowSet.
 
 (Also RowSet can be created using new() and not ResultSet, making it 
 less likely to leak memory. )
 
 A CachedRowSet is a list of rows.
 Why is it so cool and why is it called Cached?
 Becuase it is DISCONNECTED.
 So after you retrieve, you can disconnect and still access the row. You 
 do not need to create a collection.
 
 The reason people used to need a collection is becuase they used to use 
 ResultSet which is not a JavaBean and ... it needed to be connected.
 
 Vic
 
 
 vivek shrivastava wrote:
 
Hi,

Following question may sound stupid but this is something I just thought 
of it.

Can we use a helper class (Let's say HelperDB) which has CachedRowSet 
as a private member of that helper class instead of using a collection 
of ValueObject?

I am thinking of using this helper class in EmpForm object of my little 
application. In EmpAction class i can get a instance of helper class 
from EmpForm or i can build a instance of helper class in EmpAction 
class and set it to EmpForm class.

i am also thinking of implementing Iterator interface in helper class so 
that i can use this class in logic:iterate tag. Like:

logic:iterate id=emp property=HelperDB name=EmpForm

This way i don't have to create a collection of EmpVO (almost duplicate 
of Empform).

is it a good idea or bad?

Please do comment.

Thanks
vivek


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


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

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



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




No getter method?

2002-05-29 Thread Michael Marrotte

I’m using a bean:write, and Resin under SunOS says no getter method for
property (isChecked)...  I’m using several other bean:write’s on the same
JSP page and I know the setter and getter methods are defined in the form
bean for this particular property (i.e. setIsChecked and getIsChecked).  The
problem does not occur on Windows with Resin.

Any ideas?

Thanks in advance,

--Michael Marrotte


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




RE: No getter method?

2002-05-29 Thread Chakradhar Tallam

try setChecked and getChecked as ur setter  getter and use checked as the
property in bean:write.

what does getIsChecked return!

CT.

-Original Message-
From: Michael Marrotte [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 30 May 2002 11:16 AM
To: Struts Users Mailing List
Subject: No getter method?


I'm using a bean:write, and Resin under SunOS says no getter method for
property (isChecked)...  I'm using several other bean:write's on the same
JSP page and I know the setter and getter methods are defined in the form
bean for this particular property (i.e. setIsChecked and getIsChecked).  The
problem does not occur on Windows with Resin.

Any ideas?

Thanks in advance,

--Michael Marrotte


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



Advice: how strutty should I be??

2002-05-29 Thread Todd Pierce

Hi, I've only been strutting for a couple of months and I often break out
into standard JSP to do familiar things, eg:
Here is the way I have been alternating bgcolor in tables using struts. Is
there a more strutty way of doing this sort of thing, i.e. logic tags, or is
this acceptable?

%
   Collection theCollection = ...;
   boolean colorFlag = true ;
%

logic:iterate id=element name=theCollection

%
   String colorString = (colorFlag) ? #FF : #CC;
   colorFlag = !colorFlag ;
%
   tr
  td bgcolor=%= colorString %
 bean:write name=element property=someProperty//td
  td bgcolor=%= colorString %
 bean:write name=element property=anotherNumber//td
   /tr
/logic:iterate 

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




RE: Advice: how strutty should I be??

2002-05-29 Thread James Mitchell

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg26590.html

James Mitchell
Software Engineer\Struts Evangelist
Open-Tools.org
Come and see what all the fuss is about...
http://struts-atlanta.open-tools.org

 -Original Message-
 From: Todd Pierce [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 30, 2002 12:23 AM
 To: '[EMAIL PROTECTED]'
 Subject: Advice: how strutty should I be??


 Hi, I've only been strutting for a couple of months and I often break out
 into standard JSP to do familiar things, eg:
 Here is the way I have been alternating bgcolor in tables using struts. Is
 there a more strutty way of doing this sort of thing, i.e. logic
 tags, or is
 this acceptable?

 %
Collection theCollection = ...;
boolean colorFlag = true ;
 %

 logic:iterate id=element name=theCollection

 %
String colorString = (colorFlag) ? #FF : #CC;
colorFlag = !colorFlag ;
 %
tr
   td bgcolor=%= colorString %
  bean:write name=element property=someProperty//td
   td bgcolor=%= colorString %
  bean:write name=element property=anotherNumber//td
/tr
 /logic:iterate

 --
 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]




object of action servlet in action class

2002-05-29 Thread Radhika Nadkarni

hi,
Can anyone tell me as to how to get an object of ActionServlet in the Action
class ???

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


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




RE: object of action servlet in action class

2002-05-29 Thread Chakradhar Tallam

by calling getServlet method

ActionServlet as = this.getServlet();

Refer to:
http://jakarta.apache.org/struts/doc-1.0.2/api/org/apache/struts/action/Acti
on.html

CT.

-Original Message-
From: Radhika Nadkarni [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 30 May 2002 2:43 PM
To: [EMAIL PROTECTED]
Subject: object of action servlet in action class


hi,
Can anyone tell me as to how to get an object of ActionServlet in the Action
class ???

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


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