Re: gui html

2005-04-27 Thread brenmcguire
I used it only for its treeview tag. It is pretty interesting. For the
rest I think it's best to use Struts Menu.
Beware of the license! It is somewhat complicated. Its source is
available, you can use it freely if your project is GPL, but you have to
ask for permission (I don't know if it involves money) if you want to use
it in commercial applications.
Ciao
Antonio Petrelli

Günther Wieser wrote:

>looks very interesting, has anyone experience in using it? is it stable?
>
>would save a lo of time for if so...
>
>kr,
>guenther
>-Original Message-
>From: Lucas Bern [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, April 26, 2005 5:46 PM
>To: Struts Users Mailing List
>Subject: gui html
>
>
>has anybody seen http://struts.application-servers.com
>
>
>
>waiting for coments...
>
>Lucas
>


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



Re: Action <==> Tile

2005-04-27 Thread brenmcguire
In struts-config.xml change the  element this way:
  
Ciao
Antonio Petrelli

rmanchu wrote:

> Dave Newton wrote:
>
>> In the struts configuration file. Instead of using a path to the JSP
you use the name of the tile. You must also be using the Tiles plugin, as
detailed in:
>
>
> i had defined it as that. and the error i get is below. menuAction is
the name of tile definition
>
> Error :: Path menuAction does not start with a "/" character
>
> i've checked whether TilesPlugin is loaded
>
> Apr 26, 2005 2:33:31 PM org.apache.struts.tiles.TilesPlugin
initDefinitionsFactory
> INFO: Tiles definition factory loaded for module '/news'.
>
> the logs seems to show that it is indeed loaded
>
>> http://struts.apache.org/userGuide/building_view.html#Tiles
>
> have checked this also. can't see anything wrong
>
> apart from that, i'm working on struts 1.3-dev version. i've included
the relevant sections - unless i'm missing something :(
>
> 
> 
> 
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
> link="/menuaction?menu=Category&form=category" />
> link="/menuaction?menu=Author&form=author" />
> link="/menuaction?menu=Picture&form=picture" />
> link="/menuaction?menu=Article&form=article" />
> 
> 
>
> 
> 
> 
> 
>  path="/menuaction"
> type="rmanchu.infoportal.actions.MenuAction"
> name=""
> validate="false"
> scope="request"
> input="menuAction">
> 
> 
> 
>
> ???
>
> riyaz
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



Re: layout hierarchies

2005-04-27 Thread brenmcguire
Errr No... Let's start from the beginning.
1. Don't give to Tiles definitions names starting with "/".
2. You can put a Tiles definitions inside another tiles definition. For
example:












I hope this clears your doubts.
Ciao
Antonio Petrelli

Laurie Harper wrote:

> Hi, how do I create layout tile hierarchies so that one layout extends
another and contributes additional content to it? What I'd like to have is
a base layout which contains markup common to every page, and then 'child'
layouts that extned the base layout and add section-specific additional
markup. Page tiles would then use the 'child' layout to get the page and
section layout rendered. Something like this:
>
> 
> 
> 
>
> 
> 
> 
> 
>
> 
> 
> 
> 
>
> That's how I tried to set it up, but the 'path' attribute on
/section.layout overrides the 'path' attribute on /base.layout, so the
content of /pages/base/layout.jsp isn't rendered. Also, the implicit
'content' attribute used by /pages/base/layout.jsp and
/pages/section/layout.jsp conflict. I also tried this:
>
> 
> 
> 
>
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
>
> but that didn't work as the 'section-name' attribute isn't defined in
the tiles context available to /pages/section/layout.jsp. Moving the 'put'
for the 'content' attribute down into the /section.view definition doesn't
seem to help; I get the same error.
>
> Logically, I'm looking for something like this:
>
> +---+   +--+
> | /base.layout  |   | /section.layout  |
> |---|   |--|
> | title: String | includes  | title: String|
> | content: JSP  |-->| section-name: String |
> +---+   | section-content: JSP |
> |--|
> | title = "The Se..."  |
> | content = /path/...  |
> +--+
> |
> | includes
> |
> V
>  +-+
>  | /section.view   |
>  |-|
>  | section-name = "The se  |
>  | section-content = /path/... |
>  +-+
>
> Is what I'm trying to do possible? Is my objective clear from the above?
I can put together a more complete demo if necessary.
>
> L.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



Re: Action <==> Tile

2005-04-27 Thread rmanchu
hi
[EMAIL PROTECTED] wrote:
In struts-config.xml change the  element this way:
  
this worked. struts-config comments:





so i don't know y i have to explicitly declare it.
using: strts 1.3-dev tiles 1.3-dev
thanx a bunch
riyaz
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


problem with Tiles & Struts 1.3

2005-04-27 Thread Marco Mistroni








Hello all,

    I
have moved my application from Struts 1.1 to Struts 1.3, and I am currently
experiencing problems

With Tiles.

Attached are all the files that I was
using with Struts 1.1. and the application worked just
fine.

I am afraid I don’t have exception
stack trace (I had problem with my mail account L  ), however

I was getting  NullPointerException   in pages where there was the tile:insert  tag
(such as

classicLayout.jsp)

 

Now, for use with Struts 1.3 I have
changed the struts-tiles.tld since I noticed that
some classes

Were moved to a different package  (from org.apache.struts.taglib.tiles to org.apache.struts.tiles.taglib)

 

So I have replaced all org.apache.struts.taglib.tiles
to org.apache.struts.tiles.taglib, but still when
running

My application I got exception.

 

Can anyone spot what’s the problem
with tiles? Am I using the correct  struts-tiles.tld?


Do I need additional files?

I tried to put the two logging files
mentioned in the Tiles documentation in my \classes directory, but still

I am experiencing same problem.

 

Has anyone succeeded to use tiles with
Struts 1.3?

 

Thanks in advance and regars

    marco

 

 

 

 








http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>



  
  

  
  

   
  
  
  
  
  
  
  
  


  
  
  
  
  
  
  
  
  
  
  

  

   
  
  
  
  
  
  
  
   
  
  
   

   
  
  
  
  
  
  
  
   
   
  
  
  
  
  
  
  
  
  



  
  
  
  
  
  
  
  
  
  
   

   
  
  
  	 	
   
  

  
  

  
  

  
  

  
  

  
  



  
   

  
  


  
  


  
  


  
  


  
  


  
  


  
  
  


  
  


  
  


  
  


  
  


  
  


  
  
  
  


  
  
  


  
  


  
  


  
  



  

   

  

  













  







 http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd";>






  
  
  

  
  
	  
	  
	  
	  
	  
  

  
  
  

  


  
  
  
  


  
  
  
  
  
  

  
  
  
  
  

  

  




  


  

  
  

  


  

  
  

  


  

  

  
  
  
  
  
	  



  

  
  




  




	  
	  
	  
	  

  





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

Re: problem with Tiles & Struts 1.3

2005-04-27 Thread ziggler
where is struts1.3?

On 4/27/05, Marco Mistroni <[EMAIL PROTECTED]> wrote:
> 
> 
> Hello all,
> 
> I have moved my application from Struts 1.1 to Struts 1.3, and I
> am currently experiencing problems
> 
> With Tiles.
> 
> Attached are all the files that I was using with Struts 1.1. and the
> application worked just fine.
> 
> I am afraid I don't have exception stack trace (I had problem with my mail
> account L  ), however
> 
> I was getting  NullPointerException   in pages where there was the
> tile:insert  tag (such as
> 
> classicLayout.jsp)
> 
>  
> 
> Now, for use with Struts 1.3 I have changed the struts-tiles.tld since I
> noticed that some classes
> 
> Were moved to a different package  (from org.apache.struts.taglib.tiles to
> org.apache.struts.tiles.taglib)
> 
>  
> 
> So I have replaced all org.apache.struts.taglib.tiles to
> org.apache.struts.tiles.taglib, but still when running
> 
> My application I got exception.
> 
>  
> 
> Can anyone spot what's the problem with tiles? Am I using the correct 
> struts-tiles.tld? 
> 
> Do I need additional files?
> 
> I tried to put the two logging files mentioned in the Tiles documentation in
> my \classes directory, but still
> 
> I am experiencing same problem.
> 
>  
> 
> Has anyone succeeded to use tiles with Struts 1.3?
> 
>  
> 
> Thanks in advance and regars
> 
> marco
> 
>  
> 
>  
> 
>  
> 
>  
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 


-- 
Fasten your seat belt. Here we go... 
笑口常开,笑天下可笑之人!


RE: problem with Tiles & Struts 1.3 / Found exception stack Trace

2005-04-27 Thread Marco Mistroni


Hello all,
I found exception stack trace for problem mentioned..
Will it 'enlighten' my problem?
I have moved my application from Struts 1.1 to Struts 1.3, and I
am currently experiencing problems
With Tiles.
Attached are all the files that I was using with Struts 1.1. and the
application worked just fine.

Full stack trace provided at end of message..
Now, for use with Struts 1.3 I have changed the struts-tiles.tld since I
noticed that some classes
Were moved to a different package  (from org.apache.struts.taglib.tiles
to org.apache.struts.tiles.taglib)

So I have replaced all org.apache.struts.taglib.tiles to
org.apache.struts.tiles.taglib, but still when running
My application I got exception.

Can anyone spot what's the problem with tiles? Am I using the correct
struts-tiles.tld? 
Do I need additional files?
I tried to put the two logging files mentioned in the Tiles
documentation in my \classes directory, but still
I am experiencing same problem.

Has anyone succeeded to use tiles with Struts 1.3?

Thanks in advance and regars
Marco



 STACK TRACE ***

22:46:47,234 INFO  [STDOUT] [TRACE] PropertyMessageResources -
-loadLocale() 2005-04-26 22:46:47,234 INFO  [STDOUT] [TRACE]
PropertyMessageResources - -  Loading resource
'org/apache/struts/taglib/html/LocalStrings.properties'
2005-04-26 22:46:47,234 INFO  [STDOUT] [TRACE] PropertyMessageResources
- -  Loading resource completed 2005-04-26 22:46:47,234 ERROR
[org.jboss.web.localhost.Engine] ApplicationDispatcher[/strutschain-web]
Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException
at
org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:366
)
at
org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:186)
at
org.apache.jsp.insertBody_jsp._jspService(insertBody_jsp.java:172)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:324)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:157)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
her.java:703)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp
atcher.java:589)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat
cher.java:499)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja
va:966)
at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:5
81)
at
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
at
org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
at
org.apache.struts.tiles.taglib.InsertTag.doInclude(InsertTag.java:756)
at
org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTa
g.java:888)
at
org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:458)
at
org.apache.jsp.layout.classicLayout_jsp._jspx_meth_tiles_insert_1(classi
cLayout_jsp.java:298)
at
org.apache.jsp.layout.classicLayout_jsp._jspService(classicLayout_jsp.ja
va:116)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:324)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:157)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc
her.java:703)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp
atcher.java:589)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat
cher.java:499)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja
va:966)
at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:5
81)
at
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
at
org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)

RE: problem with Tiles & Struts 1.3

2005-04-27 Thread Marco Mistroni
http://svn.apache.org/builds/struts/maven/nightly/

-Original Message-
From: ziggler [mailto:[EMAIL PROTECTED] 
Sent: 27 April 2005 09:09
To: Struts Users Mailing List
Subject: Re: problem with Tiles & Struts 1.3

where is struts1.3?
On 4/27/05, Marco Mistroni <[EMAIL PROTECTED]> wrote:> > > Hello
all,> > I have moved my application from Struts 1.1 to
Struts 1.3, and I> am currently experiencing problems> > With Tiles.> >
Attached are all the files that I was using with Struts 1.1. and the>
application worked just fine.> > I am afraid I don't have exception
stack trace (I had problem with my mail> account L  ), however> > I was
getting  NullPointerException   in pages where there was the>
tile:insert  tag (such as> > classicLayout.jsp)> >  > > Now, for use
with Struts 1.3 I have changed the struts-tiles.tld since I> noticed
that some classes> > Were moved to a different package  (from
org.apache.struts.taglib.tiles to> org.apache.struts.tiles.taglib)> >  >
> So I have replaced all org.apache.struts.taglib.tiles to>
org.apache.struts.tiles.taglib, but still when running> > My application
I got exception.> >  > > Can anyone spot what's the problem with tiles?
Am I using the correct > struts-tiles.tld? > > Do I need additional
files?> > I tried to put the two logging files mentioned in the Tiles
documentation in> my \classes directory, but still> > I am experiencing
same problem.> >  > > Has anyone succeeded to use tiles with Struts
1.3?> >  > > Thanks in advance and regars> > marco> >  > >
> >  > >  >
->
To unsubscribe, e-mail: [EMAIL PROTECTED]> For
additional commands, e-mail: [EMAIL PROTECTED]> > > 

-- Fasten your seat belt. Here we go... 笑口常开,笑天下可笑之人!


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



Re: Creating Action Mapping Definition Dynamically

2005-04-27 Thread Dakota Jack
For what it is worth, Vinod, you can get the effective equivalent of
adding a dynamic ActionMapping by providing an application or class to
deal with the fields of the ActionMapping.  For example, you might
forgo most aspects of the ActionMapping and provide a dynamic class
accessible by a base action class which handles parameter, input,
etc., so long as you don't need those for the Struts internals.

If you do, of course, that is another matter altogether.  But, even
that is not too hard to change, if you look at the internals a bit.  I
would personally be interested in where you go with this, if it still
interests you after you have seen Joe's information.

Thanks,

Jack

On 4/26/05, vinod perla <[EMAIL PROTECTED]> wrote:
> vinod wrote:
> Thankyou very much Mr.Joe Germuska u've given enough information for me.
> regards
> vinod
> 
> On 4/26/05, Joe Germuska <[EMAIL PROTECTED]> wrote:
> > At 5:19 PM +0530 4/26/05, vinod perla wrote:
> > >vinod wrote:
> > >Is it possible to create the Action Mapping Definitions dynamically?
> > >If so please help me how to do this.
> >
> > To do this, you're really going to have to dig into Struts' code; as
> > it is now, you can't dynamically add new ActionMappings to the
> > ModuleConfig because it is frozen after the config files are read;
> > otherwise, you'd have synchronization problems.  If you looked at
> > ModuleConfig, perhaps you could come up with an alternate
> > implementation which managed the sync issues and still allowed you to
> > dynamically add ActionMappings.
> >
> > Struts itself makes new ActionMappings as part of wild-card path
> > matching, but those mappings only last for the duration of the
> > request they are servicing.
> >
> > Joe
> >
> > --
> > Joe Germuska
> > [EMAIL PROTECTED]
> > http://blog.germuska.com
> > "Narrow minds are weapons made for mass destruction"  -The Ex
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Multiple forms on one page

2005-04-27 Thread Fleischle, Samuel
Does Struts support more then one form on a single page?

 

In my application I put two forms on one page, one form containing the data
and one form containing some search fields. I define one form bean for each
form. But if I submit one of these forms, e.g. the search form, I got only
one form filled with data by my form bean.

 

Is there a way, Struts provides to forms?

 

Regards,

Sam



RE: Multiple forms on one page

2005-04-27 Thread Paul McCulloch
You can only submit one form at a time. This is an http issue - not a Struts
one.

The solution I have used is to combine all the neccessary fields into a
single form. 

I typically do this with nested objects  - so my form bean would have two
properties "data" & "search" say. These objects themselves contain the
String properties for user input. If you are using JSPs then the nested
taglib makes rendering this stuff easy.

Paul

> -Original Message-
> From: Fleischle, Samuel [mailto:[EMAIL PROTECTED]
> Sent: 2005/27/04 09:48
> To: user@struts.apache.org
> Subject: Multiple forms on one page
> 
> 
> Does Struts support more then one form on a single page?
> 
>  
> 
> In my application I put two forms on one page, one form 
> containing the data
> and one form containing some search fields. I define one form 
> bean for each
> form. But if I submit one of these forms, e.g. the search 
> form, I got only
> one form filled with data by my form bean.
> 
>  
> 
> Is there a way, Struts provides to forms?
> 
>  
> 
> Regards,
> 
> Sam
> 
> 

Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you 
are not the addressee indicated in this message (or responsible for delivery of 
the message to such person), you may not copy or deliver this message to 
anyone. In such case, you should destroy this message, and notify us 
immediately. If you or your employer does not consent to Internet email 
messages of this kind, please advise us immediately. Opinions, conclusions and 
other information expressed in this message are not given or endorsed by my 
Company or employer unless otherwise indicated by an authorised representative 
independent of this message.
 
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being 
transmitted via electronic mail attachments we cannot guarantee that 
attachments do not contain computer virus code.  You are therefore strongly 
advised to undertake anti virus checks prior to accessing the attachment to 
this electronic mail.  Axios Systems Ltd grants no warranties regarding 
performance use or quality of any attachment and undertakes no liability for 
loss or damage howsoever caused.


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



RE: Multiple forms on one page

2005-04-27 Thread hermod . opstvedt
Hi

No problem - I have several pages that are multiform - Validation is
also supported for multiform.

Hermod

-Original Message-
From: Fleischle, Samuel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 10:48 AM
To: user@struts.apache.org
Subject: Multiple forms on one page


Does Struts support more then one form on a single page?

 

In my application I put two forms on one page, one form containing the
data
and one form containing some search fields. I define one form bean for
each
form. But if I submit one of these forms, e.g. the search form, I got
only
one form filled with data by my form bean.

 

Is there a way, Struts provides to forms?

 

Regards,

Sam



* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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



RE: Multiple forms on one page

2005-04-27 Thread hermod . opstvedt
Hi

Addendum : You can only post 1 form at a time

Hermod

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 2:50 PM
To: user@struts.apache.org
Subject: RE: Multiple forms on one page


Hi

No problem - I have several pages that are multiform - Validation is
also supported for multiform.

Hermod

-Original Message-
From: Fleischle, Samuel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 27, 2005 10:48 AM
To: user@struts.apache.org
Subject: Multiple forms on one page


Does Struts support more then one form on a single page?

 

In my application I put two forms on one page, one form containing the
data
and one form containing some search fields. I define one form bean for
each
form. But if I submit one of these forms, e.g. the search form, I got
only
one form filled with data by my form bean.

 

Is there a way, Struts provides to forms?

 

Regards,

Sam



* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR
Group
cannot accept any payment orders or other legally binding correspondence
with
customers as a part of an email. 

This email message has been virus checked by the virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *


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

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



RE: PDF Streamed To Client

2005-04-27 Thread Brian McGovern
Well i guess thats technically correct but arguably if my action is delegating 
control flow by validating the user is who he says he is before showing the pdf 
to him.  He can be bounced to 3 other screens via this action class and I don't 
see much difference in using the action to stream back response or creating a 
byte[] or refernce to the File and storing in request scope.  

Ive achieved reuse by dumping a modified version of Nick's handy method in a 
utility class that I'll be reusing on other projects.  
So while i agree with you on principle, i think this might be one of those 
cases where in practice its a better idea to stray from stringent mvc pattern.

But I'm just a hack. :)
-B

-Original Message-
From: Andre Van Klaveren [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 26, 2005 4:51 PM
To: Struts Users Mailing List; Nick Heudecker
Subject: Re: PDF Streamed To Client


Brian,

While Nick's solution certainly works, it doesn't follow best
practices, MVC in particular (No offense Nick).  Technically a view
component such as a Servlet or JSP should be responsible for writing
the response back to the client.  The Action is responsible for flow
control and interacting with business components.

I solved a similar problem by having the Action place a byte array of
the PDF content and the content type (as a String) in request scope
and forwarding to a Servlet.  The Servlet's (called
BinaryOutputServlet) sole purpose is to retrieve the content and
content type from request scope and stream it back to the client. 
This is where Nick's example code would fit nicely.

Now, in your case you would probably put a reference to the PDF file
in request scope instead of a byte array, especially if the PDF
documents are large.  In my case the content was relatively small and
was generated dynamically.

If you design the Servlet generically it can be reused in any project
that requires the application to stream the content of any type of
file to the client (gif, jpg, rdf, etc).




-- 
Virtually,
Andre Van Klaveren
SCP

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


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



RE: problem with Tiles & Struts 1.3 / Found exception stack Trace

2005-04-27 Thread Joe Germuska
Just to make sure, if you put the contents of this tile directly in 
line in the page, you don't get this exception?  I'm using tiles 
generally with Struts 1.3 with no problems, including inlining 
elements of a form where the form is in one page and the fields are 
in other tiles.

I did run into some problems in the last week when I tried to use 
 inside a , but that's not something I've 
done a lot in the past, so I wrote it off to an incomplete 
understanding of the Tiles JSP tags.   I was trying to basically pass 
a "parameter" object into the page scope of the referenced JSP, but 
it wasn't being found.  My work around was to put things in request 
scope instead of expecting tiles:put to get them into the page scope 
of the included tile -- is that the nature of your problem?  From the 
description it could be.  I don't quite see how Struts 1.3 could be 
to blame, but maybe I'm just not thinking about it correctly.

Joe
At 9:10 AM +0100 4/27/05, Marco Mistroni wrote:
Hello all,
I found exception stack trace for problem mentioned..
Will it 'enlighten' my problem?
I have moved my application from Struts 1.1 to Struts 1.3, and I
am currently experiencing problems
With Tiles.
Attached are all the files that I was using with Struts 1.1. and the
application worked just fine.
Full stack trace provided at end of message..
Now, for use with Struts 1.3 I have changed the struts-tiles.tld since I
noticed that some classes
Were moved to a different package  (from org.apache.struts.taglib.tiles
to org.apache.struts.tiles.taglib)
So I have replaced all org.apache.struts.taglib.tiles to
org.apache.struts.tiles.taglib, but still when running
My application I got exception.
Can anyone spot what's the problem with tiles? Am I using the correct
struts-tiles.tld?
Do I need additional files?
I tried to put the two logging files mentioned in the Tiles
documentation in my \classes directory, but still
I am experiencing same problem.
Has anyone succeeded to use tiles with Struts 1.3?
Thanks in advance and regars
Marco

 STACK TRACE ***
22:46:47,234 INFO  [STDOUT] [TRACE] PropertyMessageResources -
-loadLocale() 2005-04-26 22:46:47,234 INFO  [STDOUT] [TRACE]
PropertyMessageResources - -  Loading resource
'org/apache/struts/taglib/html/LocalStrings.properties'
2005-04-26 22:46:47,234 INFO  [STDOUT] [TRACE] PropertyMessageResources
- -  Loading resource completed 2005-04-26 22:46:47,234 ERROR
[org.jboss.web.localhost.Engine] ApplicationDispatcher[/strutschain-web]
Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException
at
org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:366
)
at
org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:186)
at
org.apache.jsp.insertBody_jsp._jspService(insertBody_jsp.java:172)
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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


Change dinamycly the input parameter of an action

2005-04-27 Thread Rodolfo =?iso-8859-1?Q?Garc=EDa_Esteban=2FCYII?=
Hi

I'm using struts 1.2.4. I have an action which can be called from two 
pages, and I need to change the input parameter in order to return and 
show the errors in the previous page, by this cause I can't specify the 
input parameter in struts-config.xml, I need to do something in my 
application dinamycly.

Best Regards 

Rodolfo 

RE: problem with Tiles & Struts 1.3 / Found exception stack Trace

2005-04-27 Thread Marco Mistroni
Hello Joe,
I am not blaming Struts 1.3  :-)
I am actually more concerned with Tiles by itself, since I was not 
Able to use the same .tld file that I was able to use with Struts 1.1

Can anyone send me (or tell me where I can find) the latest
struts-tiles.tld?

Because the one with Struts 1.1. does not work with Tiles 1.3

Thanx and regards
marco

-Original Message-
From: Joe Germuska [mailto:[EMAIL PROTECTED] 
Sent: 27 April 2005 14:10
To: Marco Mistroni; user@struts.apache.org
Subject: RE: problem with Tiles & Struts 1.3 / Found exception stack
Trace

Just to make sure, if you put the contents of this tile directly in 
line in the page, you don't get this exception?  I'm using tiles 
generally with Struts 1.3 with no problems, including inlining 
elements of a form where the form is in one page and the fields are 
in other tiles.

I did run into some problems in the last week when I tried to use 
 inside a , but that's not something I've 
done a lot in the past, so I wrote it off to an incomplete 
understanding of the Tiles JSP tags.   I was trying to basically pass 
a "parameter" object into the page scope of the referenced JSP, but 
it wasn't being found.  My work around was to put things in request 
scope instead of expecting tiles:put to get them into the page scope 
of the included tile -- is that the nature of your problem?  From the 
description it could be.  I don't quite see how Struts 1.3 could be 
to blame, but maybe I'm just not thinking about it correctly.

Joe

At 9:10 AM +0100 4/27/05, Marco Mistroni wrote:
>Hello all,
>   I found exception stack trace for problem mentioned..
>Will it 'enlighten' my problem?
>   I have moved my application from Struts 1.1 to Struts 1.3, and I
>am currently experiencing problems
>With Tiles.
>Attached are all the files that I was using with Struts 1.1. and the
>application worked just fine.
>
>Full stack trace provided at end of message..
>Now, for use with Struts 1.3 I have changed the struts-tiles.tld since
I
>noticed that some classes
>Were moved to a different package  (from org.apache.struts.taglib.tiles
>to org.apache.struts.tiles.taglib)
>
>So I have replaced all org.apache.struts.taglib.tiles to
>org.apache.struts.tiles.taglib, but still when running
>My application I got exception.
>
>Can anyone spot what's the problem with tiles? Am I using the correct
>struts-tiles.tld?
>Do I need additional files?
>I tried to put the two logging files mentioned in the Tiles
>documentation in my \classes directory, but still
>I am experiencing same problem.
>
>Has anyone succeeded to use tiles with Struts 1.3?
>
>Thanks in advance and regars
>   Marco
>
>
>
> STACK TRACE ***
>
>22:46:47,234 INFO  [STDOUT] [TRACE] PropertyMessageResources -
>-loadLocale() 2005-04-26 22:46:47,234 INFO  [STDOUT] [TRACE]
>PropertyMessageResources - -  Loading resource
>'org/apache/struts/taglib/html/LocalStrings.properties'
>2005-04-26 22:46:47,234 INFO  [STDOUT] [TRACE] PropertyMessageResources
>- -  Loading resource completed 2005-04-26 22:46:47,234 ERROR
>[org.jboss.web.localhost.Engine]
ApplicationDispatcher[/strutschain-web]
>Servlet.service() for servlet jsp threw exception
>javax.servlet.jsp.JspException
>   at
>org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:36
6
>)
>   at
>org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:186)
>   at
>org.apache.jsp.insertBody_jsp._jspService(insertBody_jsp.java:172)

-- 
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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


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



Re: problem with Tiles & Struts 1.3 / Found exception stack Trace

2005-04-27 Thread Niall Pemberton
Its in the tiles 1.3 jar (i.e. struts-tiles-1.3.0-dev.jar)

Niall

- Original Message - 
From: "Marco Mistroni" <[EMAIL PROTECTED]>
Sent: Wednesday, April 27, 2005 2:58 PM


> Hello Joe,
> I am not blaming Struts 1.3  :-)
> I am actually more concerned with Tiles by itself, since I was not 
> Able to use the same .tld file that I was able to use with Struts 1.1
> 
> Can anyone send me (or tell me where I can find) the latest
> struts-tiles.tld?
> 
> Because the one with Struts 1.1. does not work with Tiles 1.3
> 
> Thanx and regards
> marco



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



Re: PDF Streamed To Client

2005-04-27 Thread Andre Van Klaveren
It's was just a suggestion.  I've been bitten in the past when I
wasn't consistant in my design or I didn't follow patterns.  Mostly
with maintenance.  It's made me more of a purist when it comes to
patterns.

To clarify, the Action doesn't build the byte[] array.  It would
retrieve it from a utility class or business component.  It's job is
to place it in request scope and forward to the Servlet.

It's a great idea to move Nick's code to a utility class.  Putting
that code in an Action certainly would be a bad idea.  Action classes
are controllers and shouldn't directly handle business logic or
building a response to the client.  This would directly couple your
application logic to the Stuts framework.  (Last couple sentences
meant for newbies reading this thread).


-- 
Virtually,
Andre Van Klaveren
Architect III, SCP
Enterprise Transformation Services
Unisys Corporation



On 4/27/05, Brian McGovern <[EMAIL PROTECTED]> wrote:
> Well i guess thats technically correct but arguably if my action is 
> delegating control flow by validating the user is who he says he is before 
> showing the pdf to him.  He can be bounced to 3 other screens via this action 
> class and I don't see much difference in using the action to stream back 
> response or creating a byte[] or refernce to the File and storing in request 
> scope.
> 
> Ive achieved reuse by dumping a modified version of Nick's handy method in a 
> utility class that I'll be reusing on other projects.
> So while i agree with you on principle, i think this might be one of those 
> cases where in practice its a better idea to stray from stringent mvc pattern.
> 
> But I'm just a hack. :)
> -B
> 
> -Original Message-
> From: Andre Van Klaveren [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 26, 2005 4:51 PM
> To: Struts Users Mailing List; Nick Heudecker
> Subject: Re: PDF Streamed To Client
> 
> Brian,
> 
> While Nick's solution certainly works, it doesn't follow best
> practices, MVC in particular (No offense Nick).  Technically a view
> component such as a Servlet or JSP should be responsible for writing
> the response back to the client.  The Action is responsible for flow
> control and interacting with business components.
> 
> I solved a similar problem by having the Action place a byte array of
> the PDF content and the content type (as a String) in request scope
> and forwarding to a Servlet.  The Servlet's (called
> BinaryOutputServlet) sole purpose is to retrieve the content and
> content type from request scope and stream it back to the client.
> This is where Nick's example code would fit nicely.
> 
> Now, in your case you would probably put a reference to the PDF file
> in request scope instead of a byte array, especially if the PDF
> documents are large.  In my case the content was relatively small and
> was generated dynamically.
> 
> If you design the Servlet generically it can be reused in any project
> that requires the application to stream the content of any type of
> file to the client (gif, jpg, rdf, etc).
> 
> --
> Virtually,
> Andre Van Klaveren
> SCP
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: Change dinamycly the input parameter of an action

2005-04-27 Thread Joe Germuska
At 3:38 PM +0200 4/27/05, Rodolfo García Esteban/CYII wrote:
Hi
I'm using struts 1.2.4. I have an action which can be called from two
pages, and I need to change the input parameter in order to return and
show the errors in the previous page, by this cause I can't specify the
input parameter in struts-config.xml, I need to do something in my
application dinamycly.
There are two direct work-arounds, although neither may totally satisfy you:
a) use more than one action mapping, so that each 
of two paths can have independent values for 
"input" while sharing most of the rest of the 
config, as well as sharing the processing logic. 
This may be easier using wildcard path 
mapping[1], which allows you to populate values 
of the ActionMapping based on matches, so you 
could have:


This might work better with the ability to 
specify that values for "input" are forward names 
rather than application paths.[2]  Of course, you 
don't have to use wildcards.

We've recently also added support for "extending" 
config elements, although I believe this is only 
in the Struts 1.3 dev branch (did it get added to 
1.2.x?)  That would provide an alternative 
approach.

b) perform the validation inside your action and 
manually return the correct forward config object 
based on the context.  This is really not that 
hard.  Here's how you'd do in an action what 
Struts does for you if "validate" is set to 
"true"; from here, you should be able to adapt to 
return a different forward.:

public ActionForward execute(m,f,req,res)  throws Exception{
  // replicate Struts validation
  ActionErrors errors = f.validate(m,req);
  if (errors.size != 0) {
saveErrors(req,errors);
return m.getInputForward();
  }
  // carry on with valid-state controller logic
}
A lot of Struts users have valid reasons to do 
the validation inside the action instead of 
leaving it up to Struts -- maybe you are one of 
them.  To be honest, though, I think the first 
solution is a better one, whether or not you use 
wildcards.

Joe
References:
[1] 
http://struts.apache.org/userGuide/building_controller.html#action_mapping_wildcards
[2] http://struts.apache.org/userGuide/configuration.html#controller_config
--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

Filter Being Called Repeatedly

2005-04-27 Thread Scott Purcell
Hello,
I decided to try and implement a filter for my struts application. A filter 
that would check for a session object, and if it does not exist, send the user 
to a certain link.

Anyway, I found an example in the "Struts Cookbook" and I am implementing it. 
But for whatever reason, when I hit a page that should redirect me, I can see 
(by debug statements) that the filter is hit 10 or more times, and then I get 
an error stating: "Redirect limit for this URL exceeeded. Unable to load the 
requested page") in an alert Box?

I would really like to get this going:
Here is the code, and the web.xml I am using. Any help would be appreciated.

CODE
public class AppFilter implements Filter {

  private String onFailure = "index.jsp";
  private FilterConfig filterConfig;

  public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
onFailure = filterConfig.getInitParameter("onFailure");
  }

  public void doFilter(ServletRequest request,
   ServletResponse response,
   FilterChain chain)
throws IOException, ServletException {


Logger log = Logger.getLogger(this.getClass().getName());
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
log.info("X");
log.info("AppFilter called for a request.");
log.info("param onFailure=" + onFailure);

// if the page is onFailure page continue down the chain
if (req.getServletPath().equals(onFailure)) {
  log.info(" equals ");
  chain.doFilter(request, response);
  return;
}


HttpSession session = req.getSession();
AppObject appObject = (AppObject)session.getAttribute("APP_OBJECT");
if (appObject == null) {
  log.info("AppObject is null, send to front door.");
  log.info("sending path=" + req.getContextPath() + onFailure);
  resp.sendRedirect(req.getContextPath() + onFailure);
  return;
} else {
  log.info("");
  chain.doFilter(request, response);
}
  }

  public void destroy() {
  }
}


WEB.XML

AppFilter
com.mb.purcell.app.AppFilter

  onFailure
  /index.jsp

  

  
AppFilter
/*
  

Thanks,

Scott K Purcell

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



Re: Filter Being Called Repeatedly

2005-04-27 Thread Tom Ziemer
Hi,
I just looked briefly at your code, but could it be, that your filter 
intercepts the calls to the error page as well? So you would be 
redirecting, then interceptiong, redirecting, etc.

Maybe you could try a different URL pattern for the filter - something 
like /protected/*

Hope this helps.
Regards,
Tom
Scott Purcell wrote:
Hello,
I decided to try and implement a filter for my struts application. A filter 
that would check for a session object, and if it does not exist, send the user 
to a certain link.
Anyway, I found an example in the "Struts Cookbook" and I am implementing it. But for 
whatever reason, when I hit a page that should redirect me, I can see (by debug statements) that 
the filter is hit 10 or more times, and then I get an error stating: "Redirect limit for this 
URL exceeeded. Unable to load the requested page") in an alert Box?
I would really like to get this going:
Here is the code, and the web.xml I am using. Any help would be appreciated.
CODE
public class AppFilter implements Filter {
  private String onFailure = "index.jsp";
  private FilterConfig filterConfig;
  public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
onFailure = filterConfig.getInitParameter("onFailure");
  }
  public void doFilter(ServletRequest request,
   ServletResponse response,
   FilterChain chain)
throws IOException, ServletException {
Logger log = Logger.getLogger(this.getClass().getName());
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
log.info("X");
log.info("AppFilter called for a request.");
log.info("param onFailure=" + onFailure);
// if the page is onFailure page continue down the chain
if (req.getServletPath().equals(onFailure)) {
  log.info(" equals ");
  chain.doFilter(request, response);
  return;
}
HttpSession session = req.getSession();
AppObject appObject = (AppObject)session.getAttribute("APP_OBJECT");
if (appObject == null) {
  log.info("AppObject is null, send to front door.");
  log.info("sending path=" + req.getContextPath() + onFailure);
  resp.sendRedirect(req.getContextPath() + onFailure);
  return;
} else {
  log.info("");
  chain.doFilter(request, response);
}
  }
  public void destroy() {
  }
}
WEB.XML

AppFilter
com.mb.purcell.app.AppFilter

  onFailure
  /index.jsp

  
  
AppFilter
/*
  
Thanks,
Scott K Purcell
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Filter Being Called Repeatedly

2005-04-27 Thread gdeschen
Umh... I believe that you don't need the  return after the chain.doFilter

if (req.getServletPath().equals(onFailure)) {
  log.info(" equals ");
  chain.doFilter(request, response);
remove -->   return;
}

HTH,
Glenn




"Scott Purcell" <[EMAIL PROTECTED]> 
27/04/2005 10:19 AM
Please respond to
"Struts Users Mailing List" 


To

cc

Subject
Filter Being Called Repeatedly
Classification








Hello,
I decided to try and implement a filter for my struts application. A 
filter that would check for a session object, and if it does not exist, 
send the user to a certain link.

Anyway, I found an example in the "Struts Cookbook" and I am implementing 
it. But for whatever reason, when I hit a page that should redirect me, I 
can see (by debug statements) that the filter is hit 10 or more times, and 
then I get an error stating: "Redirect limit for this URL exceeeded. 
Unable to load the requested page") in an alert Box?

I would really like to get this going:
Here is the code, and the web.xml I am using. Any help would be 
appreciated.

CODE
public class AppFilter implements Filter {

  private String onFailure = "index.jsp";
  private FilterConfig filterConfig;

  public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
onFailure = filterConfig.getInitParameter("onFailure");
  }

  public void doFilter(ServletRequest request,
   ServletResponse response,
   FilterChain chain)
throws IOException, ServletException {


Logger log = Logger.getLogger(this.getClass().getName());
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
log.info("X");
log.info("AppFilter called for a request.");
log.info("param onFailure=" + onFailure);

// if the page is onFailure page continue down the chain
if (req.getServletPath().equals(onFailure)) {
  log.info(" equals ");
  chain.doFilter(request, response);
  return;
}


HttpSession session = req.getSession();
AppObject appObject = (AppObject)session.getAttribute("APP_OBJECT");
if (appObject == null) {
  log.info("AppObject is null, send to front door.");
  log.info("sending path=" + req.getContextPath() + onFailure);
  resp.sendRedirect(req.getContextPath() + onFailure);
  return;
} else {
  log.info("");
  chain.doFilter(request, response);
}
  }

  public void destroy() {
  }
}


WEB.XML

AppFilter
com.mb.purcell.app.AppFilter

  onFailure
  /index.jsp

  

  
AppFilter
/*
  

Thanks,

Scott K Purcell

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





Re: Filter Being Called Repeatedly

2005-04-27 Thread Dave Newton
Scott Purcell wrote:
   if (req.getServletPath().equals(onFailure)) {
 

[...]
 resp.sendRedirect(req.getContextPath() + onFailure);
 

Are you sure that getServletPath() and getContextPath() + onFailure are 
the same thing? My impression is that getServletPath() may not be 
returning what you think it is; check the J2EE JavaDocs and see if 
that's really what you want.

Also, might as well create a class logger rather than instantiating one 
every time through.

Dave

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


RE: problem with Tiles & Struts 1.3 / Found exception stack Trace

2005-04-27 Thread Joe Germuska
At 2:58 PM +0100 4/27/05, Marco Mistroni wrote:
I am not blaming Struts 1.3  :-)
I am actually more concerned with Tiles by itself, since I was not
Able to use the same .tld file that I was able to use with Struts 1.1
Yes, we should make sure to note that on the "migrating to Struts 
1.3" page -- which I just got started...
Oh, wait -- the TLD hasn't changed since 1.2, and I think we should 
continue to have each migration notes page be focused on "since the 
last version" -- so I left this out -- but still, Marco and any 
others who are checking out Struts 1.3 are encouraged to help build 
this page:

http://wiki.apache.org/struts/StrutsUpgradeNotes12to13
By the way, I'm currently in active development on a Struts 1.3 
application, and people should not be too nervous about checking it 
out -- things are humming along smoothly, and while I'm not claiming 
that 1.3 is tested enough to be deemed GA, it's not showing any 
really weird behavior.  You don't need to do anything differently to 
use Struts 1.3 (besides understanding the new multi-jar packaging); 
you should be able to totally ignore most of the new stuff until 
you're ready for it.  In fact, we need some users like that to help 
verify our goal of backwards compatibility!

http://svn.apache.org/builds/struts/nightly/
Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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


RE: Filter Being Called Repeatedly

2005-04-27 Thread Benedict, Paul C
Scott,

I recommend you use getRequestURI to check against the path
(context-relative) you want to protect. Also, it's possible you're seeing
hits against the images in your page (10 images will call your filter 10
times).

Thanks,
Paul

-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 10:20 AM
To: user@struts.apache.org
Subject: Filter Being Called Repeatedly


Hello,
I decided to try and implement a filter for my struts application. A filter
that would check for a session object, and if it does not exist, send the
user to a certain link.

Anyway, I found an example in the "Struts Cookbook" and I am implementing
it. But for whatever reason, when I hit a page that should redirect me, I
can see (by debug statements) that the filter is hit 10 or more times, and
then I get an error stating: "Redirect limit for this URL exceeeded. Unable
to load the requested page") in an alert Box?

I would really like to get this going:
Here is the code, and the web.xml I am using. Any help would be appreciated.

CODE
public class AppFilter implements Filter {

  private String onFailure = "index.jsp";
  private FilterConfig filterConfig;

  public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
onFailure = filterConfig.getInitParameter("onFailure");
  }

  public void doFilter(ServletRequest request,
   ServletResponse response,
   FilterChain chain)
throws IOException, ServletException {


Logger log = Logger.getLogger(this.getClass().getName());
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
log.info("X");
log.info("AppFilter called for a request.");
log.info("param onFailure=" + onFailure);

// if the page is onFailure page continue down the chain
if (req.getServletPath().equals(onFailure)) {
  log.info(" equals ");
  chain.doFilter(request, response);
  return;
}


HttpSession session = req.getSession();
AppObject appObject = (AppObject)session.getAttribute("APP_OBJECT");
if (appObject == null) {
  log.info("AppObject is null, send to front door.");
  log.info("sending path=" + req.getContextPath() + onFailure);
  resp.sendRedirect(req.getContextPath() + onFailure);
  return;
} else {
  log.info("");
  chain.doFilter(request, response);
}
  }

  public void destroy() {
  }
}


WEB.XML

AppFilter
com.mb.purcell.app.AppFilter

  onFailure
  /index.jsp

  

  
AppFilter
/*
  

Thanks,

Scott K Purcell

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





--
Notice:  This e-mail message, together with any attachments, contains 
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
--

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



Re: Filter Being Called Repeatedly

2005-04-27 Thread Dave Newton
[EMAIL PROTECTED] wrote:
Umh... I believe that you don't need the  return after the chain.doFilter
 

You do, otherwise the remaining code in the filter will be executed 
after the request is finished being processed: filters _wrap_ a request. 
This is how a gzipping filter works, for example.

Dave

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


Re: Filter Being Called Repeatedly

2005-04-27 Thread gdeschen
Oh yes... I carefully looked at the code.
Apologies for misleading the list. 

- Glenn




Dave Newton <[EMAIL PROTECTED]> 
27/04/2005 10:42 AM
Please respond to
"Struts Users Mailing List" 


To
Struts Users Mailing List 
cc

Subject
Re: Filter Being Called Repeatedly
Classification








[EMAIL PROTECTED] wrote:

>Umh... I believe that you don't need the  return after the chain.doFilter
> 
>
You do, otherwise the remaining code in the filter will be executed 
after the request is finished being processed: filters _wrap_ a request. 
This is how a gzipping filter works, for example.

Dave



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





Re: Change dinamycly the input parameter of an action

2005-04-27 Thread Hubert Rabago
On 4/27/05, Joe Germuska <[EMAIL PROTECTED]> wrote:
> We've recently also added support for "extending"
> config elements, although I believe this is only
> in the Struts 1.3 dev branch (did it get added to
> 1.2.x?)  

Configuration inheritance only got added to the 1.3 branch.  Putting
it in 1.2 would involve a DTD change.

Hubert

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



struts-el webapp NullPointerException

2005-04-27 Thread Morris Jones
I can't find any record in the bugzilla of this being a known problem, but
maybe the struts-el libraries aren't tracked in the bugzilla:
Tomcat 5.0.28
Struts 1.2.4
Windows 2000
I installed the strutsel-exercise-taglib webapp from contrib/struts-el/webapp.
The index page gives a NullPointerException:
java.lang.NullPointerException
org.apache.struts.taglib.TagUtils.pageURL(TagUtils.java:1114)

rg.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:466)

org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:329)
org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:475)
org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:334)
org.apache.strutsel.taglib.html.ELLinkTag.doStartTag(ELLinkTag.java:666)
org.apache.jsp.index_jsp._jspx_meth_html$1el_link_0(index_jsp.java:146)
org.apache.jsp.index_jsp._jspService(index_jsp.java:118)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Is this webapp DOA, or just not useful in this environment?
Mojo
--
Morris Jones
Monrovia, CA
http://www.whiteoaks.com
Old Town Astronomers: http://www.otastro.org
--
Morris Jones
Monrovia, CA
http://www.whiteoaks.com
Old Town Astronomers: http://www.otastro.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Manipulate String at view.

2005-04-27 Thread Rutger Heijmerikx
Hello,

Beeing a newbie i could use some help with the following:

I am busy with a simple struts application that displays an email message.
Now within the jsp this is the code to display the message;


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/taglibs-string" prefix="str"%>
<%
String strRowStyle = "detailRowEven";
%>

>From :
Subject:
In reply to :


">

   

Message





<%
if (strRowStyle == "detailRowEven") {
strRowStyle = "detailRowOdd";
} else {
strRowStyle = "detailRowEven";
}
%>


 - ">

-
Now, i want to manipulate the mailcontent so that not only linebreaks
will be shown as above but i want to check if a line starts with let's
say a quote sign like '>' so that i can apply some formatting to that
line.

I assume you know what i mean :)

Where should i, or what is the best way to do this?

If you want to push me to the right direction i would be very grateful!


Regards,

Rutger

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



Re: Filter Being Called Repeatedly

2005-04-27 Thread David Evans
Hello,

comments below

On Wed, 2005-04-27 at 10:19, Scott Purcell wrote:
> Hello,
> I decided to try and implement a filter for my struts application. A filter 
> that would check for a session object, and if it does not exist, send the 
> user to a certain link.
> 
> Anyway, I found an example in the "Struts Cookbook" and I am implementing it. 
> But for whatever reason, when I hit a page that should redirect me, I can see 
> (by debug statements) that the filter is hit 10 or more times, and then I get 
> an error stating: "Redirect limit for this URL exceeeded. Unable to load the 
> requested page") in an alert Box?
> 
> I would really like to get this going:
> Here is the code, and the web.xml I am using. Any help would be appreciated.
> 
> CODE
> public class AppFilter implements Filter {
> 
>   private String onFailure = "index.jsp";
>   private FilterConfig filterConfig;
> 
>   public void init(FilterConfig filterConfig) throws ServletException {
> this.filterConfig = filterConfig;
> onFailure = filterConfig.getInitParameter("onFailure");
>   }
> 
>   public void doFilter(ServletRequest request,
>ServletResponse response,
>FilterChain chain)
> throws IOException, ServletException {
> 
> 
> Logger log = Logger.getLogger(this.getClass().getName());
> HttpServletRequest req = (HttpServletRequest) request;
> HttpServletResponse resp = (HttpServletResponse) response;
> log.info("X");
> log.info("AppFilter called for a request.");
> log.info("param onFailure=" + onFailure);
> 
> // if the page is onFailure page continue down the chain
i think you should change this:
> if (req.getServletPath().equals(onFailure)) {
to this:
  if (req.getPathInfo().equals(onFailure)) {
>   log.info(" equals ");
>   chain.doFilter(request, response);
>   return;
> }
> 
> 
> HttpSession session = req.getSession();
> AppObject appObject = (AppObject)session.getAttribute("APP_OBJECT");
> if (appObject == null) {
>   log.info("AppObject is null, send to front door.");
>   log.info("sending path=" + req.getContextPath() + onFailure);
>   resp.sendRedirect(req.getContextPath() + onFailure);
>   return;
> } else {
>   log.info("");
>   chain.doFilter(request, response);
> }
>   }
> 
>   public void destroy() {
>   }
> }
> 
> 
> WEB.XML
> 
> AppFilter
> com.mb.purcell.app.AppFilter
> 
>   onFailure
>   /index.jsp
> 
>   
> 
>   
> AppFilter
> /*
>   
> 
> Thanks,
> 
> Scott K Purcell
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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



Dynamically generating parameterized links using logic:iterate

2005-04-27 Thread Randall Svancara
First of all, I know this must be a frequently asked question.  In java
server pages, I would do this:

<%
while someiterator.hasNext(){
%>
Go

<%
}

This seems fairly strait forward.  Using the struts framework and tags,
I am struggling.





I am not sure what I need to use in order to grab the parcel value from
the form bean.  I know my syntax is wrong.

Can someone please demonstrate the proper way to do this.

Randall

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



Double submit and Implied Save

2005-04-27 Thread Nancy Lin
Our application required that if user enter some data and click on
other menu link or tab without clicking the submit button, the page
will automatically be save.  The problem is it is causing double
submit, first the save submit action will be called and then the menu
link action that user want to go to.  But since xml configuration
tells where to go when the save submit action is sucessful, the
second action never gets called.

Anyone have similar application that required this implied save? Any
solution or suggestion are welcome.

Thanks.
Cometcosmo


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: Dynamically generating parameterized links using logic:iterate

2005-04-27 Thread Michael Jouravlev
I guess, it would something like this:


  

  
 

where com.acme.ParcelObj is the object type, which is collected within
"results" and which has parcel property.

Michael.

On 4/27/05, Randall Svancara <[EMAIL PROTECTED]> wrote:
> First of all, I know this must be a frequently asked question.  In java
> server pages, I would do this:
> 
> <%
> while someiterator.hasNext(){
> %>
> Go
> 
> <%
> }
> 
> This seems fairly strait forward.  Using the struts framework and tags,
> I am struggling.
> 
> 
>  paramId="parcel" > property="parcel"/>
> 
> 
> I am not sure what I need to use in order to grab the parcel value from
> the form bean.  I know my syntax is wrong.
> 
> Can someone please demonstrate the proper way to do this.
> 
> Randall
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: struts-el webapp NullPointerException

2005-04-27 Thread Woodchuck
hihi Morris,

sorry but i have to ask, why do you need the struts-el library when you
are using Tomcat 5.0.28?

Tomcat 5 already has EL capability built-in.


woodchuck


--- Morris Jones <[EMAIL PROTECTED]> wrote:
> I can't find any record in the bugzilla of this being a known
> problem, but
> maybe the struts-el libraries aren't tracked in the bugzilla:
> 
> Tomcat 5.0.28
> Struts 1.2.4
> Windows 2000
> 
> I installed the strutsel-exercise-taglib webapp from
> contrib/struts-el/webapp.
> 
> The index page gives a NullPointerException:
> 
> java.lang.NullPointerException
>   org.apache.struts.taglib.TagUtils.pageURL(TagUtils.java:1114)
> 
>
rg.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:466)
> 
>
org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:329)
>   org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:475)
>   org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:334)
> 
>
org.apache.strutsel.taglib.html.ELLinkTag.doStartTag(ELLinkTag.java:666)
> 
>
org.apache.jsp.index_jsp._jspx_meth_html$1el_link_0(index_jsp.java:146)
>   org.apache.jsp.index_jsp._jspService(index_jsp.java:118)
>   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
> 
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
>   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 
> Is this webapp DOA, or just not useful in this environment?
> 
> Mojo
> -- 
> Morris Jones
> Monrovia, CA
> http://www.whiteoaks.com
> Old Town Astronomers: http://www.otastro.org
> -- 
> Morris Jones
> Monrovia, CA
> http://www.whiteoaks.com
> Old Town Astronomers: http://www.otastro.org
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: Double submit and Implied Save

2005-04-27 Thread Erik Weber
Nancy, could you try to be a little more specific and clearer in your 
explanations?

Nancy Lin wrote:
Our application required that if user enter some data and click on
other menu link or tab without clicking the submit button, the page
will automatically be save.
Do you mean that you are submitting the form anyway, using JavaScript, 
just with a different action mapping?

The problem is it is causing double
submit, first the save submit action will be called and then the menu
link action that user want to go to.
So I take it the first submit happens when the user clicks a link 
(instead of the submit button), and JavaScript is submitting the form 
(for a save action and not a normal submit action). Correct? So how/when 
does the second submit come into play? Doesn't your action process the 
first submit and then forward to the page the user wanted? Or are you 
using a redirect? Even so, a redirect would only be a GET request, so I 
don't understand the double submit.

 But since xml configuration
tells where to go when the save submit action is sucessful, the
second action never gets called.
 

Hmm, this seems to contradict what you just said. I don't understand.
Erik

Anyone have similar application that required this implied save? Any
solution or suggestion are welcome.
Thanks.
Cometcosmo
__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

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


Re: struts-el webapp NullPointerException

2005-04-27 Thread Morris Jones
Hmmm!  I must have missed that in the docs.  Thanks!
So for the same functionality, I should include the JSTL _and_ Struts 
taglibs in my JSPs and write expressions with abandon?  And perhaps that 
explains why the struts-el webapp doesn't work with Tomcat 5 ...

Mojo
Woodchuck wrote:
hihi Morris,
sorry but i have to ask, why do you need the struts-el library when you
are using Tomcat 5.0.28?
Tomcat 5 already has EL capability built-in.
woodchuck
--- Morris Jones <[EMAIL PROTECTED]> wrote:
I can't find any record in the bugzilla of this being a known
problem, but
maybe the struts-el libraries aren't tracked in the bugzilla:
Tomcat 5.0.28
Struts 1.2.4
Windows 2000
I installed the strutsel-exercise-taglib webapp from
contrib/struts-el/webapp.
The index page gives a NullPointerException:
java.lang.NullPointerException
org.apache.struts.taglib.TagUtils.pageURL(TagUtils.java:1114)

rg.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:466)

org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:329)
org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:475)
org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:334)

org.apache.strutsel.taglib.html.ELLinkTag.doStartTag(ELLinkTag.java:666)

org.apache.jsp.index_jsp._jspx_meth_html$1el_link_0(index_jsp.java:146)
org.apache.jsp.index_jsp._jspService(index_jsp.java:118)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Is this webapp DOA, or just not useful in this environment?
Mojo
--
Morris Jones
Monrovia, CA
http://www.whiteoaks.com
Old Town Astronomers: http://www.otastro.org
--
Morris Jones
Monrovia, CA
http://www.whiteoaks.com
Old Town Astronomers: http://www.otastro.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

--
Morris Jones
Monrovia, CA
http://www.whiteoaks.com
Old Town Astronomers: http://www.otastro.org
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Double submit and Implied Save

2005-04-27 Thread Michael Jouravlev
On 4/27/05, Nancy Lin <[EMAIL PROTECTED]> wrote:
> Our application required that if user enter some data and click on
> other menu link or tab without clicking the submit button, the page
> will automatically be save.

What is the point in submit button then? Maybe you would rather show a
dialog "Do you want to save the changes?" then allow user to save, and
then he would click the menuitem.

> The problem is it is causing double
> submit, first the save submit action will be called and then the menu
> link action that user want to go to.  But since xml configuration
> tells where to go when the save submit action is sucessful, the
> second action never gets called.
> 
> Anyone have similar application that required this implied save? Any
> solution or suggestion are welcome.

I would say that problem that you have is not what usually is called
"double submit". Right off the bat I can think of the following
choices (unless you want to show dialog window and to do save in two
separate steps).

* When menuitem is clicked, append a parameter to submit action URL,
which would define where to go next on success, and submit the form to
save action. Just a small javascript.

* Submit form to the target menuaction and save data from there. In
this case you would have to process request manually (maybe use
LazyAction from 1.2.6? Not sure, not used it).

Michael.

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



Re: struts-el webapp NullPointerException

2005-04-27 Thread Woodchuck
yup, that's what i do now.  works great :)


--- Morris Jones <[EMAIL PROTECTED]> wrote:
> Hmmm!  I must have missed that in the docs.  Thanks!
> 
> So for the same functionality, I should include the JSTL _and_ Struts
> 
> taglibs in my JSPs and write expressions with abandon?  And perhaps
> that 
> explains why the struts-el webapp doesn't work with Tomcat 5 ...
> 
> Mojo
> 
> Woodchuck wrote:
> > hihi Morris,
> > 
> > sorry but i have to ask, why do you need the struts-el library when
> you
> > are using Tomcat 5.0.28?
> > 
> > Tomcat 5 already has EL capability built-in.
> > 
> > 
> > woodchuck
> > 
> > 
> > --- Morris Jones <[EMAIL PROTECTED]> wrote:
> > 
> >>I can't find any record in the bugzilla of this being a known
> >>problem, but
> >>maybe the struts-el libraries aren't tracked in the bugzilla:
> >>
> >>Tomcat 5.0.28
> >>Struts 1.2.4
> >>Windows 2000
> >>
> >>I installed the strutsel-exercise-taglib webapp from
> >>contrib/struts-el/webapp.
> >>
> >>The index page gives a NullPointerException:
> >>
> >>java.lang.NullPointerException
> >>org.apache.struts.taglib.TagUtils.pageURL(TagUtils.java:1114)
> >>
> >>
> > 
> >
>
rg.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:466)
> > 
> >>
> >
>
org.apache.struts.taglib.TagUtils.computeURLWithCharEncoding(TagUtils.java:329)
> > 
> >>
> org.apache.struts.taglib.html.LinkTag.calculateURL(LinkTag.java:475)
> >>org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:334)
> >>
> >>
> > 
> >
>
org.apache.strutsel.taglib.html.ELLinkTag.doStartTag(ELLinkTag.java:666)
> > 
> >>
> >
>
org.apache.jsp.index_jsp._jspx_meth_html$1el_link_0(index_jsp.java:146)
> > 
> >>org.apache.jsp.index_jsp._jspService(index_jsp.java:118)
> >>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
> >>javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >>
> >>
> > 
> >
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
> > 
> >>
> >
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
> > 
> >>org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> >>javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >>
> >>Is this webapp DOA, or just not useful in this environment?
> >>
> >>Mojo
> >>-- 
> >>Morris Jones
> >>Monrovia, CA
> >>http://www.whiteoaks.com
> >>Old Town Astronomers: http://www.otastro.org
> >>-- 
> >>Morris Jones
> >>Monrovia, CA
> >>http://www.whiteoaks.com
> >>Old Town Astronomers: http://www.otastro.org
> >>
>
>>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> > 
> > 
> > __
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around 
> > http://mail.yahoo.com 
> > 
> >
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> Morris Jones
> Monrovia, CA
> http://www.whiteoaks.com
> Old Town Astronomers: http://www.otastro.org
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: Dynamically generating parameterized links using logic:iterate

2005-04-27 Thread Randall Svancara
Thanks,

That worked.  I need to read the documentation!!! 

-Original Message-
From: Michael Jouravlev [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 12:21 PM
To: Struts Users Mailing List
Subject: Re: Dynamically generating parameterized links using
logic:iterate

I guess, it would something like this:


  

  
 

where com.acme.ParcelObj is the object type, which is collected within
"results" and which has parcel property.

Michael.

On 4/27/05, Randall Svancara <[EMAIL PROTECTED]> wrote:
> First of all, I know this must be a frequently asked question.  In 
> java server pages, I would do this:
> 
> <%
> while someiterator.hasNext(){
> %>
> Go
> 
> <%
> }
> 
> This seems fairly strait forward.  Using the struts framework and 
> tags, I am struggling.
> 
> 

>  paramId="parcel" > property="parcel"/>
> 
> 
> I am not sure what I need to use in order to grab the parcel value 
> from the form bean.  I know my syntax is wrong.
> 
> Can someone please demonstrate the proper way to do this.
> 
> Randall
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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


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



Re: throw exception in servlet filter - no error page displayed

2005-04-27 Thread Adam Hardy
On 26/04/05 18:48 Grzegorz Stasica wrote:
My doFilter method looks like that:
public void doFilter(ServletRequest arg0, ServletResponse arg1,
FilterChain arg2) throws IOException, ServletException {
arg2.doFilter(arg0,arg1);
try{
HibernateSessionFactory.commitTransaction();
System.out.println("koniec");
}catch(DAOException e){
throw new ServletException(e);
}finally{
HibernateSessionFactory.closeSession();
}
}
My problem is that although DAOException is being catched and new 
ServletException is being thrown the page is already rendered. There is 
no error on the page and the only place where I can find that something 
went wrong is server log. What is wrong? Why ServletException doesn't 
affect page?
Did you mean to send this to the tomcat-user list? I think you're more 
likely to get a good technical answer there. Firstly I'd check that 
you're actually going thro the filter where you think you are. Secondly 
I'd check the servlet spec to see what is actually meant to happen when 
a filter throws an exception.

Presumably you never see the 'koniec' output?
Perhaps hibernate throws a different exception that your not catching.
Also your call to arg2.doFilter might actually commit the response 
before the exception, allowing no chance for the exception to affect the 
response.

HTH
Adam
--
struts 1.2 + tomcat 5.0.19 + java 1.4.2
Linux 2.4.20 Debian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Double submit and Implied Save

2005-04-27 Thread Nancy Lin
I apologize for the confusion please let me rephrase my questions.

1.  Here's our application requirement:
  when user modifies a page, say A and clicks on any other menu
item or link, say B without clicking any button on the modified page
A, page A needs to be automatically saved. If there is nothing wrong
during save, end user should be redirected to page B, otherwise page
A should stay with error messages.

2.   I'm trying to refactor our existing struts 1.2 based application
to support the above requirement, but I have a hard time to make it
work. Here are my challenges:
 a. How can I sequentialize the two action submits? (one is to
submit the modified page using javascript method 'onunload', the
other one is to submit the menu item user clicked). If I don't
sequentialize them, I don't know how to fullfill the requirement.

Thanks and I appreciate all your help!

Nancy
  
--- Erik Weber <[EMAIL PROTECTED]> wrote:
> Nancy, could you try to be a little more specific and clearer in
> your 
> explanations?
> 
> Nancy Lin wrote:
> 
> >Our application required that if user enter some data and click on
> >other menu link or tab without clicking the submit button, the
> page
> >will automatically be save.
> >
> Do you mean that you are submitting the form anyway, using
> JavaScript, 
> just with a different action mapping?
> 
> >The problem is it is causing double
> >submit, first the save submit action will be called and then the
> menu
> >link action that user want to go to.
> >
> So I take it the first submit happens when the user clicks a link 
> (instead of the submit button), and JavaScript is submitting the
> form 
> (for a save action and not a normal submit action). Correct? So
> how/when 
> does the second submit come into play? Doesn't your action process
> the 
> first submit and then forward to the page the user wanted? Or are
> you 
> using a redirect? Even so, a redirect would only be a GET request,
> so I 
> don't understand the double submit.
> 
> >  But since xml configuration
> >tells where to go when the save submit action is sucessful, the
> >second action never gets called.
> >  
> >
> Hmm, this seems to contradict what you just said. I don't
> understand.
> 
> Erik
> 
> 
> >Anyone have similar application that required this implied save?
> Any
> >solution or suggestion are welcome.
> >
> >Thanks.
> >Cometcosmo
> >
> >
> >__
> >Do You Yahoo!?
> >Tired of spam?  Yahoo! Mail has the best spam protection around 
> >http://mail.yahoo.com 
> >
>
>-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >  
> >
> 
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[OT] DOM & JavaScript

2005-04-27 Thread gdeschen
Greetings,

Once again I call on my trusted community for insight !
I'm adding a row to a table dynamically. All is working well except for 
one thing the Mouse events.

Here is the code for adding a row to the table.
There is more code that adds the cells to the table (not shown).
...
// Only add a row when changing the last row of the table
if ("s"+(rowWithData) == selectId) {
var row = table.insertRow(lastRowInTable);
var className = "rowNormal";

if (lastRowInTable % 2 == 0) {
className = "rowAlternate";
}
row.className = className;
row.setAttribute("onmouseover", "this.className = 'hilite';");
row.setAttribute("onmouseout", "this.className = '" + className + 
"'");
...
}


Here is the JSP code that creates the table row (at least one row is in 
the page), here the mouse events are working:


If I add an alert that dumps the innerHTML of the table after the 
row/cells are added and I compare the two rows... 
They are the same.
Why are the mouse events added dynamically not recongnized ?

BTW, using IE 6.0.2900.2180.xpsp_sp2_rtm.040803-2158

TIA,
Glenn


Re: [OT] DOM & JavaScript

2005-04-27 Thread Frank W. Zammetti
Hmm... I notice that the JSP code is referencing onMouseOver, while your 
Javascript is trying to set the attribute onmouseover... I wonder if the 
capitalization difference is an issue?  Certainly, if setAttribute() 
takes case into consideration that would do it.  You said the lines were 
identical when you looked, but could it be you glossed over the 
difference in capitalization? (I may have too).

Frank
[EMAIL PROTECTED] wrote:
Greetings,
Once again I call on my trusted community for insight !
I'm adding a row to a table dynamically. All is working well except for 
one thing the Mouse events.

Here is the code for adding a row to the table.
There is more code that adds the cells to the table (not shown).
...
// Only add a row when changing the last row of the table
if ("s"+(rowWithData) == selectId) {
var row = table.insertRow(lastRowInTable);
var className = "rowNormal";
if (lastRowInTable % 2 == 0) {
className = "rowAlternate";
}
row.className = className;
row.setAttribute("onmouseover", "this.className = 'hilite';");
row.setAttribute("onmouseout", "this.className = '" + className + 
"'");
...
}

Here is the JSP code that creates the table row (at least one row is in 
the page), here the mouse events are working:

"this.className = ''" class="
'${rowClass}'/>">

If I add an alert that dumps the innerHTML of the table after the 
row/cells are added and I compare the two rows... 
They are the same.
Why are the mouse events added dynamically not recongnized ?

BTW, using IE 6.0.2900.2180.xpsp_sp2_rtm.040803-2158
TIA,
Glenn
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Double submit and Implied Save

2005-04-27 Thread Wendy Smoak
From: "Nancy Lin" <[EMAIL PROTECTED]>
> 1.  Here's our application requirement:
>   when user modifies a page, say A and clicks on any other menu
> item or link, say B without clicking any button on the modified page
> A, page A needs to be automatically saved. If there is nothing wrong
> during save, end user should be redirected to page B, otherwise page
> A should stay with error messages.

I do this by having 'onClick()' on the links submit the current form.
Before the form submit, the javascript sets the value of a hidden form
element that will tell me where they were trying to go.

If there's an error, then the user is returned to the page with error
messages.  If not, the Action does whatever it needs to do, then decides
where to forward/redirect based on that hidden field.

-- 
Wendy Smoak


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



Re: [OT] DOM & JavaScript

2005-04-27 Thread gdeschen
Curiously... the mouse events are all in lowercase when they are shown in 
the dump.


Effective Date
CWW Schedule Type
Delete


- - - - - This is from the JSP - - - - - - -

03 January 2004 
 
 1 Week Cycle 2 Week 
Cycle 3 Week Cycle 4 
Week Cycle Regular Week 
Schedule 
 
 

- - - - - - - This is the row added dynamically - - - - - - -


http://nati02:5001/hronline/secure/WEB-INF/personal/timeAndAttendance/cWWHistory.jsp#";>http://nati02:5001/hronline/images/calendar.jpg"; width=16 
border=0> 
 
1 Week Cycle 2 Week 
Cycle 3 Week Cycle 4 
Week Cycle Regular Week 
Schedule 
 
 

- Glenn




"Frank W. Zammetti" <[EMAIL PROTECTED]> 
27/04/2005 04:27 PM
Please respond to
"Struts Users Mailing List" 


To
Struts Users Mailing List 
cc

Subject
Re: [OT] DOM & JavaScript
Classification








Hmm... I notice that the JSP code is referencing onMouseOver, while your 
Javascript is trying to set the attribute onmouseover... I wonder if the 
capitalization difference is an issue?  Certainly, if setAttribute() 
takes case into consideration that would do it.  You said the lines were 
identical when you looked, but could it be you glossed over the 
difference in capitalization? (I may have too).

Frank

[EMAIL PROTECTED] wrote:
> Greetings,
> 
> Once again I call on my trusted community for insight !
> I'm adding a row to a table dynamically. All is working well except for 
> one thing the Mouse events.
> 
> Here is the code for adding a row to the table.
> There is more code that adds the cells to the table (not shown).
> ...
> // Only add a row when changing the last row of the table
> if ("s"+(rowWithData) == selectId) {
> var row = table.insertRow(lastRowInTable);
> var className = "rowNormal";
> 
> if (lastRowInTable % 2 == 0) {
> className = "rowAlternate";
> }
> row.className = className;
> row.setAttribute("onmouseover", "this.className = 'hilite';");
> row.setAttribute("onmouseout", "this.className = '" + className 
+ 
> "'");
> ...
> }
> 
> 
> Here is the JSP code that creates the table row (at least one row is in 
> the page), here the mouse events are working:
>  "this.className = ''" class=" '${rowClass}'/>">
> 
> If I add an alert that dumps the innerHTML of the table after the 
> row/cells are added and I compare the two rows... 
> They are the same.
> Why are the mouse events added dynamically not recongnized ?
> 
> BTW, using IE 6.0.2900.2180.xpsp_sp2_rtm.040803-2158
> 
> TIA,
> Glenn
> 

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


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





RE: multi-level indexed proproerty validation

2005-04-27 Thread Fogleson, Allen
Nothing personal but how many times are you going to ask this? I think I
have gotten it about 7 times now.

Al

-Original Message-
From: Saul Qunming Yuan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 26, 2005 3:27 PM
To: user@struts.apache.org
Subject: multi-level indexed proproerty validation

Hi,

I'm wondering if it's possible to specify multi-level indexed property
validation in Struts validation.xml file. I used indexListProperty
attribute inside , which works for one level of indexed property.
For multiple nested level indexed properties like
company[].it.project[].projectName, I wonder if there's a way to do
that.

thanks,
Saul


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


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



Re: [OT] DOM & JavaScript

2005-04-27 Thread Frank W. Zammetti
Interesting indeed... How about trying this... change the two lines that 
dynamically add the mouse handlers to:

row.onMouseOver = "this.className = 'hilite';";
row.onMouseOut = "this.className = 'rowNormal';";
I'm not 100% sure what the capitalization should be of the property your 
setting (i.e., row.onMouseOver vs. row.onmouseover vs. something else), 
but give that a shot... any time I've done dynamic table creation I 
don't remember ever using setAttribute() at all, I think I've written 
code like the above.

Frank
[EMAIL PROTECTED] wrote:
Curiously... the mouse events are all in lowercase when they are shown in 
the dump.


Effective Date
CWW Schedule Type
Delete


- - - - - This is from the JSP - - - - - - -

03 January 2004 
 
 1 Week Cycle 2 Week 
Cycle 3 Week Cycle 4 
Week Cycle Regular Week 
Schedule 
 
 

- - - - - - - This is the row added dynamically - - - - - - -


http://nati02:5001/hronline/secure/WEB-INF/personal/timeAndAttendance/cWWHistory.jsp#";>http://nati02:5001/hronline/images/calendar.jpg"; width=16 
border=0> 
 
1 Week Cycle 2 Week 
Cycle 3 Week Cycle 4 
Week Cycle Regular Week 
Schedule 
 
 

- Glenn

"Frank W. Zammetti" <[EMAIL PROTECTED]> 
27/04/2005 04:27 PM
Please respond to
"Struts Users Mailing List" 

To
Struts Users Mailing List 
cc
Subject
Re: [OT] DOM & JavaScript
Classification



Hmm... I notice that the JSP code is referencing onMouseOver, while your 
Javascript is trying to set the attribute onmouseover... I wonder if the 
capitalization difference is an issue?  Certainly, if setAttribute() 
takes case into consideration that would do it.  You said the lines were 
identical when you looked, but could it be you glossed over the 
difference in capitalization? (I may have too).

Frank
[EMAIL PROTECTED] wrote:
Greetings,
Once again I call on my trusted community for insight !
I'm adding a row to a table dynamically. All is working well except for 
one thing the Mouse events.

Here is the code for adding a row to the table.
There is more code that adds the cells to the table (not shown).
...
// Only add a row when changing the last row of the table
if ("s"+(rowWithData) == selectId) {
   var row = table.insertRow(lastRowInTable);
   var className = "rowNormal";
   if (lastRowInTable % 2 == 0) {
   className = "rowAlternate";
   }
   row.className = className;
   row.setAttribute("onmouseover", "this.className = 'hilite';");
   row.setAttribute("onmouseout", "this.className = '" + className 
+ 

"'");
...
}
Here is the JSP code that creates the table row (at least one row is in 
the page), here the mouse events are working:

"this.className = ''" class="
'${rowClass}'/>">

If I add an alert that dumps the innerHTML of the table after the 
row/cells are added and I compare the two rows... 
They are the same.
Why are the mouse events added dynamically not recongnized ?

BTW, using IE 6.0.2900.2180.xpsp_sp2_rtm.040803-2158
TIA,
Glenn

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Double submit and Implied Save

2005-04-27 Thread Scott Piker
This is more of a design issue, but I personally hate it (and find it
dangerous in some cases) when anything is "automatically" saved for the
user without their knowledge.  What if I don't want my work on page A to
be saved and really just want to go to page B?

In situations like this, I prefer to prompt the user with a message like
"Any unsaved changes on this page will be lost.  Do you want to
continue?"  If they click ok, send them to page B.  If they click
cancel, nothing happens and they are then able to manually save Page A's
data before moving on to Page B.  

You can even be intelligent about when to display this message with some
javascript that inspects the form contents (and/or listens to onblur
events) and only prompts the user if the form data has actually changed.


- Scott

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 4:25 PM
To: Struts Users Mailing List
Subject: Re: Double submit and Implied Save

From: "Nancy Lin" <[EMAIL PROTECTED]>
> 1.  Here's our application requirement:
>   when user modifies a page, say A and clicks on any other menu 
> item or link, say B without clicking any button on the modified page 
> A, page A needs to be automatically saved. If there is nothing wrong 
> during save, end user should be redirected to page B, otherwise page A

> should stay with error messages.

I do this by having 'onClick()' on the links submit the current form.
Before the form submit, the javascript sets the value of a hidden form
element that will tell me where they were trying to go.

If there's an error, then the user is returned to the page with error
messages.  If not, the Action does whatever it needs to do, then decides
where to forward/redirect based on that hidden field.

--
Wendy Smoak


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


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



Re: Double submit and Implied Save

2005-04-27 Thread Frank W. Zammetti
This is a good point that Scott makes... I've implemented this a number 
of times myself, and in all cases I do "dirty data checking" to be sure 
(a) I don't prompt the user it nothing has changed and (b) I DO prompt 
them if ANYTHING has changed.

Frank
Scott Piker wrote:
This is more of a design issue, but I personally hate it (and find it
dangerous in some cases) when anything is "automatically" saved for the
user without their knowledge.  What if I don't want my work on page A to
be saved and really just want to go to page B?
In situations like this, I prefer to prompt the user with a message like
"Any unsaved changes on this page will be lost.  Do you want to
continue?"  If they click ok, send them to page B.  If they click
cancel, nothing happens and they are then able to manually save Page A's
data before moving on to Page B.  

You can even be intelligent about when to display this message with some
javascript that inspects the form contents (and/or listens to onblur
events) and only prompts the user if the form data has actually changed.
- Scott
-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 27, 2005 4:25 PM
To: Struts Users Mailing List
Subject: Re: Double submit and Implied Save

From: "Nancy Lin" <[EMAIL PROTECTED]>
1.  Here's our application requirement:
 when user modifies a page, say A and clicks on any other menu 
item or link, say B without clicking any button on the modified page 
A, page A needs to be automatically saved. If there is nothing wrong 
during save, end user should be redirected to page B, otherwise page A

should stay with error messages.

I do this by having 'onClick()' on the links submit the current form.
Before the form submit, the javascript sets the value of a hidden form
element that will tell me where they were trying to go.
If there's an error, then the user is returned to the page with error
messages.  If not, the Action does whatever it needs to do, then decides
where to forward/redirect based on that hidden field.
--
Wendy Smoak
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Double submit and Implied Save

2005-04-27 Thread Nancy Lin
I agreed with all of you.  

As much as we had tried to convince our top level people on several
occassions that user should be warned when leaving the page without
saving the modified data.  But it was a majority rule that all our
clients wants it to be this way.  

We developers have no choice but to implement what they requested.  

So the bottom line is that our market drive us not the other way
around so we have to fulfill their needs/requirement and tried to
solve this problem.

Much appreciated.
Nancy.

--- "Frank W. Zammetti" <[EMAIL PROTECTED]> wrote:
> This is a good point that Scott makes... I've implemented this a
> number 
> of times myself, and in all cases I do "dirty data checking" to be
> sure 
> (a) I don't prompt the user it nothing has changed and (b) I DO
> prompt 
> them if ANYTHING has changed.
> 
> Frank
> 
> Scott Piker wrote:
> > This is more of a design issue, but I personally hate it (and
> find it
> > dangerous in some cases) when anything is "automatically" saved
> for the
> > user without their knowledge.  What if I don't want my work on
> page A to
> > be saved and really just want to go to page B?
> > 
> > In situations like this, I prefer to prompt the user with a
> message like
> > "Any unsaved changes on this page will be lost.  Do you want to
> > continue?"  If they click ok, send them to page B.  If they click
> > cancel, nothing happens and they are then able to manually save
> Page A's
> > data before moving on to Page B.  
> > 
> > You can even be intelligent about when to display this message
> with some
> > javascript that inspects the form contents (and/or listens to
> onblur
> > events) and only prompts the user if the form data has actually
> changed.
> > 
> > 
> > - Scott
> > 
> > -Original Message-
> > From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
> > Sent: Wednesday, April 27, 2005 4:25 PM
> > To: Struts Users Mailing List
> > Subject: Re: Double submit and Implied Save
> > 
> > From: "Nancy Lin" <[EMAIL PROTECTED]>
> > 
> >>1.  Here's our application requirement:
> >>  when user modifies a page, say A and clicks on any other
> menu 
> >>item or link, say B without clicking any button on the modified
> page 
> >>A, page A needs to be automatically saved. If there is nothing
> wrong 
> >>during save, end user should be redirected to page B, otherwise
> page A
> > 
> > 
> >>should stay with error messages.
> > 
> > 
> > I do this by having 'onClick()' on the links submit the current
> form.
> > Before the form submit, the javascript sets the value of a hidden
> form
> > element that will tell me where they were trying to go.
> > 
> > If there's an error, then the user is returned to the page with
> error
> > messages.  If not, the Action does whatever it needs to do, then
> decides
> > where to forward/redirect based on that hidden field.
> > 
> > --
> > Wendy Smoak
> > 
> > 
> >
>
-
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> >
>
-
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> > 
> > 
> > 
> 
> -- 
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
> 
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Does struts really have to construct a new form bean every time?

2005-04-27 Thread Mike Elliott
I'm trying to build an application where:

1) p1.jsp transitions via a link: /do/Something?action=initialize.

2) This causes class app.SelectionAction to have its execute() method invoked.

3) The execute() method, based on the parameter, initializes the form passed it.

4) The execute() method then transitions to p2.jsp, which renders the page.

5) A user changes something, then causes a submit to occur.

6) The submit transitions via /do/Something?action=update

7) This causes class app.SelectionAction to have its execute() method invoked.

8) The execute() method, based on the parameter, stores info from the form.

This is a reasonable scenario, right?

Somewhere between steps 1 and 3, a new form bean is created.  This is
reasonable, I guess.  Anyway, it gets initialized in step 3.  However,
somewhere between steps 4 and 8, a second new form is created, losing
the information so carefully initialized in step 3.  I don't want to
throw away the old bean.  I want to keep using the bean I so painfully
initialized in step 3.

Is that possible?  If so, how do I tell struts not to throw away the
old bean but re-use it?  If not, how does one accomplish this goal?

Here's my setup:

--- struts-config.xml --

   
  
   

   
  
 
  
   


--- p1.jsp --
<%@ taglib uri="struts/html-el" prefix="html" %>

  p1.jsp
  

  Follow this link

  


--- p2.jsp --
<%@ taglib uri="struts/html-el" prefix="html" %>
<%@ taglib uri="jstl/c" prefix="c" %>

  p2.jsp
  
 
 Your last selection:
   
 
 Pick something
 
   
 
  



--- SelectionAction.java --
package app;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import java.util.Arrays;

public class SelectionAction extends Action {
   public ActionForward execute( ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response )
throws Exception {
  SelectionForm thisForm = (SelectionForm)form;
  String action = request.getParameter( "action" );
  if ("initialize".equals( action )) {
 String[] values = new String[] { "alpha", "beta", "gamma" };
 thisForm.setSelection_list( Arrays.asList( values ) );
 thisForm.setSelected_value( "beta" );
  }
  else if ("update".equals( action )) {
 thisForm.setPrevious_selection( thisForm.getSelected_value() );
 thisForm.setSelected_value( "alpha" );
  }
  return mapping.findForward( "success" );
   }
}

--- SelectionForm.java --
package app;
import org.apache.struts.action.ActionForm;
import java.util.Arrays;
import java.util.Collection;

public class SelectionForm extends ActionForm {
   public Collection getSelection_list() {
  return selection_list;
   }
   public void setSelection_list( Collection selection_list ) {
  this.selection_list = selection_list;
   }
   public String getSelected_value() {
  return selected_value;
   }
   public void setSelected_value( String selected_value ) {
  this.selected_value = selected_value;
   }
   public String getPrevious_selection() {
  return previous_selection;
   }
   public void setPrevious_selection( String previous_selection ) {
  this.previous_selection = previous_selection;
   }
   public int getSerialNumber() {
  return serialNumber;
   }
   public SelectionForm() {
  serialNumber = nextSerialNumber++;
  System.out.println( "Creating " + serialNumber );
   }
   private Collection selection_list =
  Arrays.asList( new String[] { "red", "white", "blue" } );
   private String selected_value = "blue";
   private String previous_selection = "No previous selection";
   private int serialNumber;
   private static int nextSerialNumber = 0;
}

--- web.xml --

http://java.sun.com/dtd/web-app_2_3.dtd";>


  pr2004

  
action
org.apache.struts.action.ActionServlet

  application
  ApplicationResources


  config
  /WEB-INF/struts-config.xml


  debug
  3


  detail
  3

1
  

  
  
action
/do/*
  

  
  
pages/p1.jsp
  

  
  
struts/bean-el
/WEB-INF/taglib/struts-bean-el.tld
  

  
struts/html-el
/WEB-INF/taglib/struts-html-el.tld
  

  
struts/logic-el
/WEB-INF/taglib/struts-logic-el.tld
  

  
jstl/c
/WEB-INF/taglib/c.tld
  



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



Re: Does struts really have to construct a new form bean every time?

2005-04-27 Thread Michael Jouravlev
   
 

 
  


On 4/27/05, Mike Elliott <[EMAIL PROTECTED]> wrote:
> I'm trying to build an application where:
> 
> 1) p1.jsp transitions via a link: /do/Something?action=initialize.
> 
> 2) This causes class app.SelectionAction to have its execute() method invoked.
> 
> 3) The execute() method, based on the parameter, initializes the form passed 
> it.
> 
> 4) The execute() method then transitions to p2.jsp, which renders the page.
> 
> 5) A user changes something, then causes a submit to occur.
> 
> 6) The submit transitions via /do/Something?action=update
> 
> 7) This causes class app.SelectionAction to have its execute() method invoked.
> 
> 8) The execute() method, based on the parameter, stores info from the form.
> 
> This is a reasonable scenario, right?
> 
> Somewhere between steps 1 and 3, a new form bean is created.  This is
> reasonable, I guess.  Anyway, it gets initialized in step 3.  However,
> somewhere between steps 4 and 8, a second new form is created, losing
> the information so carefully initialized in step 3.  I don't want to
> throw away the old bean.  I want to keep using the bean I so painfully
> initialized in step 3.

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



Re: Does struts really have to construct a new form bean every time?

2005-04-27 Thread Mike Elliott
On 4/27/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
>
>   path="/Something"
> type="app.SelectionAction"
> name="selectionForm"
> scope="request"   <=== should be scope="session"
> validate="false"
> >
> 
>  
>   
> 
> On 4/27/05, Mike Elliott <[EMAIL PROTECTED]> wrote:
> > I'm trying to build an application where:
> >
> > 1) p1.jsp transitions via a link: /do/Something?action=initialize.
> >
> > 2) This causes class app.SelectionAction to have its execute() method 
> > invoked.
> >
> > 3) The execute() method, based on the parameter, initializes the form 
> > passed it.
> >
> > 4) The execute() method then transitions to p2.jsp, which renders the page.
> >
> > 5) A user changes something, then causes a submit to occur.
> >
> > 6) The submit transitions via /do/Something?action=update
> >
> > 7) This causes class app.SelectionAction to have its execute() method 
> > invoked.
> >
> > 8) The execute() method, based on the parameter, stores info from the form.
> >
> > This is a reasonable scenario, right?
> >
> > Somewhere between steps 1 and 3, a new form bean is created.  This is
> > reasonable, I guess.  Anyway, it gets initialized in step 3.  However,
> > somewhere between steps 4 and 8, a second new form is created, losing
> > the information so carefully initialized in step 3.  I don't want to
> > throw away the old bean.  I want to keep using the bean I so painfully
> > initialized in step 3.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: Does struts really have to construct a new form bean every time?

2005-04-27 Thread Mike Elliott
On 4/27/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote:

> scope="request"   <=== should be scope="session"

Thanks!  I knew it had to be something simple like that!  And I've
wasted a day and a half finding it.

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



Re: layout hierarchies

2005-04-27 Thread Laurie Harper
I was afraid that would be the answer :-( I really wanted to avoid 
having files with page fragments that weren't well formed like that... 
I'll have to dig into the Tiles code and see how ameanable the rendering 
model is to being 'masaged' into supporting what I want it to do :-)

What's wrong with starting tiles names with '/' by the way? I seem to 
remember that Struts complained when I didn't, though I've been doing it 
this way long enough I don't recall the details.

L.
[EMAIL PROTECTED] wrote:
Errr No... Let's start from the beginning.
1. Don't give to Tiles definitions names starting with "/".
2. You can put a Tiles definitions inside another tiles definition. For
example:










I hope this clears your doubts.
Ciao
Antonio Petrelli
Laurie Harper wrote:

Hi, how do I create layout tile hierarchies so that one layout extends
another and contributes additional content to it? What I'd like to have is
a base layout which contains markup common to every page, and then 'child'
layouts that extned the base layout and add section-specific additional
markup. Page tiles would then use the 'child' layout to get the page and
section layout rendered. Something like this:
   
   
   
   path="/pages/section/layout.jsp">
   
   
   
   
   
   
   
That's how I tried to set it up, but the 'path' attribute on
/section.layout overrides the 'path' attribute on /base.layout, so the
content of /pages/base/layout.jsp isn't rendered. Also, the implicit
'content' attribute used by /pages/base/layout.jsp and
/pages/section/layout.jsp conflict. I also tried this:
   
   
   
   
   
   
   
   
   
   
   
   
but that didn't work as the 'section-name' attribute isn't defined in
the tiles context available to /pages/section/layout.jsp. Moving the 'put'
for the 'content' attribute down into the /section.view definition doesn't
seem to help; I get the same error.
Logically, I'm looking for something like this:
+---+   +--+
| /base.layout  |   | /section.layout  |
|---|   |--|
| title: String | includes  | title: String|
| content: JSP  |-->| section-name: String |
+---+   | section-content: JSP |
   |--|
   | title = "The Se..."  |
   | content = /path/...  |
   +--+
   |
   | includes
   |
   V
+-+
| /section.view   |
|-|
| section-name = "The se  |
| section-content = /path/... |
+-+
Is what I'm trying to do possible? Is my objective clear from the above?
I can put together a more complete demo if necessary.
L.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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


RE: multi-level indexed proproerty validation

2005-04-27 Thread Fogleson, Allen
Wow There is something funky going on with either my mailserver or some
server between me and the list. I have seen this msg like 9 times now, I
checked the archives... it was sent once and I don't see all the list.
Anyone else experiencing this? At least before I unsubscribe and
re-subscribe :)

Even the header says it was sent Tuesday...

Al


-Original Message-
From: Saul Qunming Yuan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 26, 2005 3:27 PM
To: user@struts.apache.org
Subject: multi-level indexed proproerty validation

Hi,

I'm wondering if it's possible to specify multi-level indexed property
validation in Struts validation.xml file. I used indexListProperty
attribute inside , which works for one level of indexed property.
For multiple nested level indexed properties like
company[].it.project[].projectName, I wonder if there's a way to do
that.

thanks,
Saul


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


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



Re: layout hierarchies

2005-04-27 Thread brenmcguire
Hi

> I was afraid that would be the answer :-( I really wanted to avoid
having files with page fragments that weren't well formed like that...
I'll have to dig into the Tiles code and see how ameanable the rendering
model is to being 'masaged' into supporting what I want it to do :-)

I was a beginner too, so don't be so cruel with yourself ;-) By the way,
if you want to make something complicated, remember that you can put ANY
URL in your  element. For example, I put an Action's URL, so that it
loads some data. This Action forwards to a JSP page that will be displayed
only in that part of the page.

>
> What's wrong with starting tiles names with '/' by the way? I seem to
remember that Struts complained when I didn't, though I've been doing it
this way long enough I don't recall the details.

Page definitions are not recognized as correct paths by Struts, so that
you cannot call a page definition directly with an URL (please Struts team
correct me if I am wrong). You have two possibilities two show a Tiles
definition:
1. Through a JSP page, using:

2. You can forward to a tiles definition, i.e. in your struts config you
can use:

but you must modify the  element in your struts-config.xml:



Ciao
Antonio Petrelli



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



Re: Manipulate String at view.

2005-04-27 Thread brenmcguire
I think the best thing is to make a custom tag library. The "formatting"
part of your project should be in the "view" part of MVC. You can also use
scriptlets, maybe just to test some code, but the most elegant way is
making a custom tag library.
Ciao
Antonio Petrelli

Rutger Heijmerikx wrote:

>Hello,
>
>Beeing a newbie i could use some help with the following:
>
>I am busy with a simple struts application that displays an email
message.
>Now within the jsp this is the code to display the message;
>
>
><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
><%@ taglib uri="/WEB-INF/taglibs-string" prefix="str"%>
><%
>String strRowStyle = "detailRowEven";
>%>
>
>>From :
>Subject:
>In reply to :
>
>
>">
>
>
>
>Message
>
>
>
>
>
><%
>if (strRowStyle == "detailRowEven") {
>strRowStyle = "detailRowOdd";
>} else {
>strRowStyle = "detailRowEven";
>}
>%>
>
>
> - href="getMessage.do?id=/>">
>
>-
>Now, i want to manipulate the mailcontent so that not only linebreaks
>will be shown as above but i want to check if a line starts with let's
>say a quote sign like '>' so that i can apply some formatting to that
>line.
>
>I assume you know what i mean :)
>
>Where should i, or what is the best way to do this?
>
>If you want to push me to the right direction i would be very grateful!
>
>
>Regards,
>
>Rutger
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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