[S2] Validation - globally define regex

2010-01-21 Thread mailtolouis2020-struts
Hello,

In struts 1, I can define the regex in one file like this

constant
constant-namealphaNumeric/constant-name
constant-value[A-Za-z0-9]*/constant-value
/constant

and use like this in
var
var-namemask/var-name
var-value${alphaNumeric}/var-value
/var


Could anyone tell me how to achieve this in Struts 2 ?

I've this in validation rule and I want to put the regex in another variable, I 
tried used constant tag, but it not accept  .

field name=name
field-validator type=requiredstring
message key=@Lerror.required/
/field-validator
field-validator type=regex
  param name=expression
   ![CDATA[[A-Za-z0-9]*]
  /param
  message key=@Lerror.invalid/
 /field-validator 
/field

Thanks
LV

Convert struts tag to html

2010-01-21 Thread VSGoud

Hi Friends,
  
When i am using Data Tag s:property /, loosing linebreaks ,spaces etc.
which were there in the DataBase columns.
I am eager to convert the fetched data to html.
Could u help me out from this issue.

Srikanth
-- 
View this message in context: 
http://old.nabble.com/Convert-struts-tag-to-html-tp27257737p27257737.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [Struts 2] ?debug=console (devMode) not working

2010-01-21 Thread Lukasz Lenart
2010/1/21 Fernandes Celinio cfernan...@sopraconsulting.com:
 Yes, I did.
 I do not know why it is not working. Someone told me he had to create an 
 interceptor to make it work. Sounds weird to me.
 Unless you have another idea, I am going to give up on that one.

One thing more, please add Dojo plugin, console is based on Dojo
JavaScript library


Regards
-- 
Lukasz
http://www.lenart.org.pl/
Kapituła Javarsovia 2010
http://javarsovia.pl

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Hiding URL in struts1.2

2010-01-21 Thread Brian Thompson
You'll have to communicate the parameters *somehow*, whether that's using
POST for all your requests (but that's bad form when your requests are
simply looking up data in the database), exposing the full url, or mapping
parameters to url path elements.

I suppose you could also write the front-end to do everything with Ajax
calls, but I'd advise against it.  Such sites are annoying to end-users.
Imagine going to Amazon, bookmarking a product, then going back to the
bookmark the next day...and it takes you to the homepage!  Not very
user-friendly.

However you resolve this, please make a follow-up post to the list.  I'm
curious to see how you handle this issue.

-Brian



On Thu, Jan 21, 2010 at 12:09 AM, Zaheer Mohammad
zaheer.cse4...@gmail.comwrote:

 HI,
  Thanks to all for your valuable sugestions

   Actually i want to hide all parameters form the Url

 actual Url's are like this :


 http://localhost:8280/mspui/custumerAuthrtn.do?dispmethd=custumerAuthorizeaccountNumber=12345

 but I should get


 http://localhost:8280/mspui/

 by hiding parameters in the url.

 this is  already developed project and this is a enhancement. using post
 means i have to change much of code.is there any simple alternative  way
 of
 acheiving this.


 Thanks in Advance

 Zaheer Mohammad

 On Thu, Jan 21, 2010 at 9:47 AM, Raghuveer raghuve...@infotechsw.com
 wrote:

  Could you elaborate your requirement?
  URL will be changed when you use
 
  action name= loginv 
  class=com.test.actions.LoginAction 
  !-- Home --
 result name=app_home_action type=redirectAction
 showHome
 /result
  /action
  action name= showHome  class=com.utc.pw.spanas.actions.CHome
  /action
   -Original Message-
  From: Brian Thompson [mailto:elephant...@gmail.com]
  Sent: Wednesday, January 20, 2010 9:13 PM
  To: Struts Users Mailing List
  Subject: Re: Hiding URL in struts1.2
 
  I would look into using URLRewrite [1].  It would be easy to go from
  showing
  this in the browser:
 
  http://localhost:8180/webproject/showHome
 
  to the application processing this:
 
  http://localhost:8180/webproject/loginv.do?dispmethd=showHome
 
 
 
 
  [1] - http://tuckey.org/urlrewrite/
 
  On Wed, Jan 20, 2010 at 5:23 AM, chen thomas thomasche...@gmail.com
  wrote:
 
   Maybe you could use post method of Form to do this
  
 
 
  -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
 
 



Re: Convert struts tag to html

2010-01-21 Thread Robert Graf-Waczenski

VSGoud schrieb:

Hi Friends,

When i am using Data Tag s:property /, loosing linebreaks ,spaces etc.
which were there in the DataBase columns.
I am eager to convert the fetched data to html.
Could u help me out from this issue.

Srikanth
  
Even though your problem is completely unrelated to Struts (and 
therefore, strictly speaking, this list is the wrong place to ask), 
here's some guidance for you. There is no single html conversion of a 
set of lines of any source. The result depends on your needs. It could 
be an html table structure with fancy tr/td rows and everything and it 
could be as simple as replacing the linebreak (which itself depends on 
your server platform, i.e. Mac/Un*x/Win) with something like an html 
br entity. So ask yourself what your resulting html is supposed to 
look like, then you will surely come up with the correct solution to 
your problem.


Robert


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Where to put bean.xml (spring configuration)?

2010-01-21 Thread Emi Lu

Good morning,

Could someone tell me where to put bean.xml (spring configuration)? It 
is not shown in the following document


http://www.vaannila.com/spring/spring-ioc-1.html

Thanks a lot!
--
Lu Ying



bean.xml
=
01.?xml version=1.0 encoding=UTF-8?
02.beans xmlns=http://www.springframework.org/schema/beans;
03.xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
04.xsi:schemaLocation= http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd;

05.
06. bean id=springQuizMaster 
class=com.vaannila.SpringQuizMaster/bean
07.bean id=strutsQuizMaster 
class=com.vaannila.StrutsQuizMaster/bean


08.bean id=quizMasterService class=com.vaannila.QuizMasterService

09.property name=quizMaster

10.ref local=springQuizMaster/
11./property
12./bean
13.
14./beans


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Where to put bean.xml (spring configuration)?

2010-01-21 Thread Rafał Krupiński

On 21.01.2010 16:40, Emi Lu wrote:

Good morning,

Could someone tell me where to put bean.xml (spring configuration)? It
is not shown in the following document

http://www.vaannila.com/spring/spring-ioc-1.html

Thanks a lot!


The proper place for spring beans declaration in webapp is 
/WEB-INF/aplicationContext.xml
but this article doesn't mention how to load this file, so better for you to 
read spring documentation.
At least that part on integration with struts.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Convert struts tag to html

2010-01-21 Thread Brian Thompson
Try using s:property escape=false/.  Does that help?

-Brian



On Thu, Jan 21, 2010 at 7:28 AM, VSGoud srikanthgou...@yahoo.co.in wrote:


 Hi Friends,

 When i am using Data Tag s:property /, loosing linebreaks ,spaces etc.
 which were there in the DataBase columns.
 I am eager to convert the fetched data to html.
 Could u help me out from this issue.

 Srikanth
 --
 View this message in context:
 http://old.nabble.com/Convert-struts-tag-to-html-tp27257737p27257737.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




decorating static content with sitemesh

2010-01-21 Thread Philipp Leusmann
Hi,

I am using the sitemesh-plugin to decorate my struts-site and Im am wondering, 
if it is possible to decorate static-pages using sitemesh.
That is, I have some plain html pages which need to get the same LAF the entire 
site has.
I already added pattern/html/*/pattern to the decorators.xml, but all I 
get is an Exception when trying to open the page:

java.lang.RuntimeException: javax.servlet.ServletException: Error applying 
decorator: null

com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator.render(BaseWebAppDecorator.java:39)

com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:84)

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:82)


The Exception is raised by a NullPointerException in 
org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.render(Content, 
HttpServletRequest, HttpServletResponse, ServletContext, SiteMeshWebAppContext) 
by 
ValueStack vs = 
Dispatcher.getInstance().getContainer().getInstance(ValueStackFactory.class).createValueStack();
 

Dispatcher.getInstance() returns null

FYI, I am using the sitemesh-2.4.2 hotfix from jira

Now, is this behaviour only a bug, or is it not meant to be used with static 
content?

To find out by myself, I was desperately trying to compile struts2 and xwork 
from svn, but it continously failed and I gave up. (Maybe this is why the last 
nightly build is from 6 days ago?)

Hope somebody can help.

Regards,
 Philipp

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: decorating static content with sitemesh

2010-01-21 Thread Kawczynski, David
I have used SiteMesh to decorate static content served
up by the app server.  If the static content is served
up by apache (or some other httpd server) you're out of
luck.  

 -Original Message-
 From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
 Sent: Thursday, January 21, 2010 11:39 AM
 To: Struts Users Mailing List
 Subject: decorating static content with sitemesh
 
 Hi,
 
 I am using the sitemesh-plugin to decorate my struts-site and 
 Im am wondering, if it is possible to decorate static-pages 
 using sitemesh.
 That is, I have some plain html pages which need to get the 
 same LAF the entire site has.
 I already added pattern/html/*/pattern to the 
 decorators.xml, but all I get is an Exception when trying to 
 open the page:
 
 java.lang.RuntimeException: javax.servlet.ServletException: 
 Error applying decorator: null
   
 com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
 .render(BaseWebAppDecorator.java:39)
   
 com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
 eshFilter.java:84)
   
 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
 Filter(StrutsPrepareFilter.java:82)
 
 
 The Exception is raised by a NullPointerException in 
 org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
 nder(Content, HttpServletRequest, HttpServletResponse, 
 ServletContext, SiteMeshWebAppContext) by 
 ValueStack vs = 
 Dispatcher.getInstance().getContainer().getInstance(ValueStack
 Factory.class).createValueStack(); 
 
 Dispatcher.getInstance() returns null
 
 FYI, I am using the sitemesh-2.4.2 hotfix from jira
 
 Now, is this behaviour only a bug, or is it not meant to be 
 used with static content?
 
 To find out by myself, I was desperately trying to compile 
 struts2 and xwork from svn, but it continously failed and I 
 gave up. (Maybe this is why the last nightly build is from 6 
 days ago?)
 
 Hope somebody can help.
 
 Regards,
  Philipp
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
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 Direct contact information for 
affiliates is available at http://www.merck.com/contact/contacts.html) 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: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: decorating static content with sitemesh

2010-01-21 Thread Philipp Leusmann
David,

did you use plain sitemesh or the struts-sitemesh plugin?

Philipp

Am 21.01.2010 um 17:50 schrieb Kawczynski, David:

 I have used SiteMesh to decorate static content served
 up by the app server.  If the static content is served
 up by apache (or some other httpd server) you're out of
 luck.  
 
 -Original Message-
 From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
 Sent: Thursday, January 21, 2010 11:39 AM
 To: Struts Users Mailing List
 Subject: decorating static content with sitemesh
 
 Hi,
 
 I am using the sitemesh-plugin to decorate my struts-site and 
 Im am wondering, if it is possible to decorate static-pages 
 using sitemesh.
 That is, I have some plain html pages which need to get the 
 same LAF the entire site has.
 I already added pattern/html/*/pattern to the 
 decorators.xml, but all I get is an Exception when trying to 
 open the page:
 
 java.lang.RuntimeException: javax.servlet.ServletException: 
 Error applying decorator: null
  
 com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
 .render(BaseWebAppDecorator.java:39)
  
 com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
 eshFilter.java:84)
  
 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
 Filter(StrutsPrepareFilter.java:82)
 
 
 The Exception is raised by a NullPointerException in 
 org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
 nder(Content, HttpServletRequest, HttpServletResponse, 
 ServletContext, SiteMeshWebAppContext) by 
 ValueStack vs = 
 Dispatcher.getInstance().getContainer().getInstance(ValueStack
 Factory.class).createValueStack(); 
 
 Dispatcher.getInstance() returns null
 
 FYI, I am using the sitemesh-2.4.2 hotfix from jira
 
 Now, is this behaviour only a bug, or is it not meant to be 
 used with static content?
 
 To find out by myself, I was desperately trying to compile 
 struts2 and xwork from svn, but it continously failed and I 
 gave up. (Maybe this is why the last nightly build is from 6 
 days ago?)
 
 Hope somebody can help.
 
 Regards,
 Philipp
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 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 Direct contact information for 
 affiliates is available at http://www.merck.com/contact/contacts.html) 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: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: decorating static content with sitemesh

2010-01-21 Thread Kawczynski, David
Plain sitemesh, with it's own filter in web.xml 

 -Original Message-
 From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
 Sent: Thursday, January 21, 2010 11:58 AM
 To: Struts Users Mailing List
 Subject: Re: decorating static content with sitemesh
 
 David,
 
 did you use plain sitemesh or the struts-sitemesh plugin?
 
 Philipp
 
 Am 21.01.2010 um 17:50 schrieb Kawczynski, David:
 
  I have used SiteMesh to decorate static content served
  up by the app server.  If the static content is served
  up by apache (or some other httpd server) you're out of
  luck.  
  
  -Original Message-
  From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
  Sent: Thursday, January 21, 2010 11:39 AM
  To: Struts Users Mailing List
  Subject: decorating static content with sitemesh
  
  Hi,
  
  I am using the sitemesh-plugin to decorate my struts-site and 
  Im am wondering, if it is possible to decorate static-pages 
  using sitemesh.
  That is, I have some plain html pages which need to get the 
  same LAF the entire site has.
  I already added pattern/html/*/pattern to the 
  decorators.xml, but all I get is an Exception when trying to 
  open the page:
  
  java.lang.RuntimeException: javax.servlet.ServletException: 
  Error applying decorator: null
 
  com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
  .render(BaseWebAppDecorator.java:39)
 
  com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
  eshFilter.java:84)
 
  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
  Filter(StrutsPrepareFilter.java:82)
  
  
  The Exception is raised by a NullPointerException in 
  org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
  nder(Content, HttpServletRequest, HttpServletResponse, 
  ServletContext, SiteMeshWebAppContext) by 
  ValueStack vs = 
  Dispatcher.getInstance().getContainer().getInstance(ValueStack
  Factory.class).createValueStack(); 
  
  Dispatcher.getInstance() returns null
  
  FYI, I am using the sitemesh-2.4.2 hotfix from jira
  
  Now, is this behaviour only a bug, or is it not meant to be 
  used with static content?
  
  To find out by myself, I was desperately trying to compile 
  struts2 and xwork from svn, but it continously failed and I 
  gave up. (Maybe this is why the last nightly build is from 6 
  days ago?)
  
  Hope somebody can help.
  
  Regards,
  Philipp
  
  
 -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
  
  
  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 Direct contact information for 
 affiliates is available at 
 http://www.merck.com/contact/contacts.html) 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: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
  
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
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 Direct contact information for 
affiliates is available at http://www.merck.com/contact/contacts.html) 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: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: decorating static content with sitemesh

2010-01-21 Thread Philipp Leusmann
Ok, that would not be sufficient for me, since I use some struts in my 
decorating template, as well.

I thought, maybe struts and sitemesh could decorate static pages using the 
default action to resolve the stack

Philipp

Am 21.01.2010 um 18:01 schrieb Kawczynski, David:

 Plain sitemesh, with it's own filter in web.xml 
 
 -Original Message-
 From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
 Sent: Thursday, January 21, 2010 11:58 AM
 To: Struts Users Mailing List
 Subject: Re: decorating static content with sitemesh
 
 David,
 
 did you use plain sitemesh or the struts-sitemesh plugin?
 
 Philipp
 
 Am 21.01.2010 um 17:50 schrieb Kawczynski, David:
 
 I have used SiteMesh to decorate static content served
 up by the app server.  If the static content is served
 up by apache (or some other httpd server) you're out of
 luck.  
 
 -Original Message-
 From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
 Sent: Thursday, January 21, 2010 11:39 AM
 To: Struts Users Mailing List
 Subject: decorating static content with sitemesh
 
 Hi,
 
 I am using the sitemesh-plugin to decorate my struts-site and 
 Im am wondering, if it is possible to decorate static-pages 
 using sitemesh.
 That is, I have some plain html pages which need to get the 
 same LAF the entire site has.
 I already added pattern/html/*/pattern to the 
 decorators.xml, but all I get is an Exception when trying to 
 open the page:
 
 java.lang.RuntimeException: javax.servlet.ServletException: 
 Error applying decorator: null

 com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
 .render(BaseWebAppDecorator.java:39)

 com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
 eshFilter.java:84)

 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
 Filter(StrutsPrepareFilter.java:82)
 
 
 The Exception is raised by a NullPointerException in 
 org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
 nder(Content, HttpServletRequest, HttpServletResponse, 
 ServletContext, SiteMeshWebAppContext) by 
 ValueStack vs = 
 Dispatcher.getInstance().getContainer().getInstance(ValueStack
 Factory.class).createValueStack(); 
 
 Dispatcher.getInstance() returns null
 
 FYI, I am using the sitemesh-2.4.2 hotfix from jira
 
 Now, is this behaviour only a bug, or is it not meant to be 
 used with static content?
 
 To find out by myself, I was desperately trying to compile 
 struts2 and xwork from svn, but it continously failed and I 
 gave up. (Maybe this is why the last nightly build is from 6 
 days ago?)
 
 Hope somebody can help.
 
 Regards,
 Philipp
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 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 Direct contact information for 
 affiliates is available at 
 http://www.merck.com/contact/contacts.html) 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: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 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 Direct contact information for 
 affiliates is available at http://www.merck.com/contact/contacts.html) 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: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: decorating static content with sitemesh

2010-01-21 Thread Kawczynski, David
I have used struts tags in my decorating templates (past tense).
It is definitely possible... but not smart, IMHO.  
Why?  Response times, especially under load + time, were horrible.

I countered this by removing the struts tags from my templates, 
re-arranging the filters in web.xml, and configuring SiteMesh to 
use different decorator templates for different paths.  (Note that
this works when template content varies based on navigation path, not
on user attributes or something similar.)  Response times were much 
snappier after doing this.



 -Original Message-
 From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
 Sent: Thursday, January 21, 2010 12:26 PM
 To: Struts Users Mailing List
 Subject: Re: decorating static content with sitemesh
 
 Ok, that would not be sufficient for me, since I use some 
 struts in my decorating template, as well.
 
 I thought, maybe struts and sitemesh could decorate static 
 pages using the default action to resolve the stack
 
 Philipp
 
 Am 21.01.2010 um 18:01 schrieb Kawczynski, David:
 
  Plain sitemesh, with it's own filter in web.xml 
  
  -Original Message-
  From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
  Sent: Thursday, January 21, 2010 11:58 AM
  To: Struts Users Mailing List
  Subject: Re: decorating static content with sitemesh
  
  David,
  
  did you use plain sitemesh or the struts-sitemesh plugin?
  
  Philipp
  
  Am 21.01.2010 um 17:50 schrieb Kawczynski, David:
  
  I have used SiteMesh to decorate static content served
  up by the app server.  If the static content is served
  up by apache (or some other httpd server) you're out of
  luck.  
  
  -Original Message-
  From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
  Sent: Thursday, January 21, 2010 11:39 AM
  To: Struts Users Mailing List
  Subject: decorating static content with sitemesh
  
  Hi,
  
  I am using the sitemesh-plugin to decorate my struts-site and 
  Im am wondering, if it is possible to decorate static-pages 
  using sitemesh.
  That is, I have some plain html pages which need to get the 
  same LAF the entire site has.
  I already added pattern/html/*/pattern to the 
  decorators.xml, but all I get is an Exception when trying to 
  open the page:
  
  java.lang.RuntimeException: javax.servlet.ServletException: 
  Error applying decorator: null
   
  com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
  .render(BaseWebAppDecorator.java:39)
   
  com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
  eshFilter.java:84)
   
  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
  Filter(StrutsPrepareFilter.java:82)
  
  
  The Exception is raised by a NullPointerException in 
  org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
  nder(Content, HttpServletRequest, HttpServletResponse, 
  ServletContext, SiteMeshWebAppContext) by 
  ValueStack vs = 
  Dispatcher.getInstance().getContainer().getInstance(ValueStack
  Factory.class).createValueStack(); 
  
  Dispatcher.getInstance() returns null
  
  FYI, I am using the sitemesh-2.4.2 hotfix from jira
  
  Now, is this behaviour only a bug, or is it not meant to be 
  used with static content?
  
  To find out by myself, I was desperately trying to compile 
  struts2 and xwork from svn, but it continously failed and I 
  gave up. (Maybe this is why the last nightly build is from 6 
  days ago?)
  
  Hope somebody can help.
  
  Regards,
  Philipp
  
  
  
 -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
  
  
  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 Direct contact information for 
  affiliates is available at 
  http://www.merck.com/contact/contacts.html) 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: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
  
  
  
  
 -
  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
  For additional commands, e-mail: user-h...@struts.apache.org
  
  
  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 Direct contact information for 
 

Re: decorating static content with sitemesh

2010-01-21 Thread Philipp Leusmann
Sure it would be faster without that stuff, but since I use some 
session-related stuff (user login status etc.) , replacing it with a static 
decorator would not be feasible.

Thanks anyway for your suggestions.

Regards,
 Philipp

Am 21.01.2010 um 18:37 schrieb Kawczynski, David:

 I have used struts tags in my decorating templates (past tense).
 It is definitely possible... but not smart, IMHO.  
 Why?  Response times, especially under load + time, were horrible.
 
 I countered this by removing the struts tags from my templates, 
 re-arranging the filters in web.xml, and configuring SiteMesh to 
 use different decorator templates for different paths.  (Note that
 this works when template content varies based on navigation path, not
 on user attributes or something similar.)  Response times were much 
 snappier after doing this.
 
 
 
 -Original Message-
 From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
 Sent: Thursday, January 21, 2010 12:26 PM
 To: Struts Users Mailing List
 Subject: Re: decorating static content with sitemesh
 
 Ok, that would not be sufficient for me, since I use some 
 struts in my decorating template, as well.
 
 I thought, maybe struts and sitemesh could decorate static 
 pages using the default action to resolve the stack
 
 Philipp
 
 Am 21.01.2010 um 18:01 schrieb Kawczynski, David:
 
 Plain sitemesh, with it's own filter in web.xml 
 
 -Original Message-
 From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
 Sent: Thursday, January 21, 2010 11:58 AM
 To: Struts Users Mailing List
 Subject: Re: decorating static content with sitemesh
 
 David,
 
 did you use plain sitemesh or the struts-sitemesh plugin?
 
 Philipp
 
 Am 21.01.2010 um 17:50 schrieb Kawczynski, David:
 
 I have used SiteMesh to decorate static content served
 up by the app server.  If the static content is served
 up by apache (or some other httpd server) you're out of
 luck.  
 
 -Original Message-
 From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
 Sent: Thursday, January 21, 2010 11:39 AM
 To: Struts Users Mailing List
 Subject: decorating static content with sitemesh
 
 Hi,
 
 I am using the sitemesh-plugin to decorate my struts-site and 
 Im am wondering, if it is possible to decorate static-pages 
 using sitemesh.
 That is, I have some plain html pages which need to get the 
 same LAF the entire site has.
 I already added pattern/html/*/pattern to the 
 decorators.xml, but all I get is an Exception when trying to 
 open the page:
 
 java.lang.RuntimeException: javax.servlet.ServletException: 
 Error applying decorator: null
  
 com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
 .render(BaseWebAppDecorator.java:39)
  
 com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteM
 eshFilter.java:84)
  
 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.do
 Filter(StrutsPrepareFilter.java:82)
 
 
 The Exception is raised by a NullPointerException in 
 org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator.re
 nder(Content, HttpServletRequest, HttpServletResponse, 
 ServletContext, SiteMeshWebAppContext) by 
 ValueStack vs = 
 Dispatcher.getInstance().getContainer().getInstance(ValueStack
 Factory.class).createValueStack(); 
 
 Dispatcher.getInstance() returns null
 
 FYI, I am using the sitemesh-2.4.2 hotfix from jira
 
 Now, is this behaviour only a bug, or is it not meant to be 
 used with static content?
 
 To find out by myself, I was desperately trying to compile 
 struts2 and xwork from svn, but it continously failed and I 
 gave up. (Maybe this is why the last nightly build is from 6 
 days ago?)
 
 Hope somebody can help.
 
 Regards,
 Philipp
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 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 Direct contact information for 
 affiliates is available at 
 http://www.merck.com/contact/contacts.html) 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: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
 Notice:  This e-mail message, together with 

Re: decorating static content with sitemesh

2010-01-21 Thread Brian Thompson
Can you get the Struts filter to execute for static pages?  It seems like
that would fix the Dispatcher.getInstance() problem.  Something like

action name=* class=com.opensymphony.xwork2.ActionSupport
  result name=success/staticHTML/{1}/result
/action

in your struts.xml seems like it would do the trick (be careful of
overriding your regular actions!).

-Brian



On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann 
philipp.leusm...@rwth-aachen.de wrote:

 Sure it would be faster without that stuff, but since I use some
 session-related stuff (user login status etc.) , replacing it with a static
 decorator would not be feasible.

 Thanks anyway for your suggestions.

 Regards,
  Philipp
 snip



Re: decorating static content with sitemesh

2010-01-21 Thread Philipp Leusmann
Hi Brian,

that would work, but then I'll have to make a call to 
/staticHTML/page.html.action to access /staticHTML/page.html. 
Would be a workaround, but I still would prefer the call to *.html

Philipp

Am 21.01.2010 um 19:18 schrieb Brian Thompson:

 Can you get the Struts filter to execute for static pages?  It seems like
 that would fix the Dispatcher.getInstance() problem.  Something like
 
 action name=* class=com.opensymphony.xwork2.ActionSupport
  result name=success/staticHTML/{1}/result
 /action
 
 in your struts.xml seems like it would do the trick (be careful of
 overriding your regular actions!).
 
 -Brian
 
 
 
 On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann 
 philipp.leusm...@rwth-aachen.de wrote:
 
 Sure it would be faster without that stuff, but since I use some
 session-related stuff (user login status etc.) , replacing it with a static
 decorator would not be feasible.
 
 Thanks anyway for your suggestions.
 
 Regards,
 Philipp
 snip
 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RE: decorating static content with sitemesh

2010-01-21 Thread Kawczynski, David
How do you have struts mapped in web.xml?  If it is mapped to /*
no you don't.  If it is mapped to *.action, add another mapping 
for /staticHTML/* 


 -Original Message-
 From: Philipp Leusmann [mailto:philipp.leusm...@rwth-aachen.de] 
 Sent: Thursday, January 21, 2010 2:42 PM
 To: Struts Users Mailing List
 Subject: Re: decorating static content with sitemesh
 
 Hi Brian,
 
 that would work, but then I'll have to make a call to 
 /staticHTML/page.html.action to access /staticHTML/page.html. 
 Would be a workaround, but I still would prefer the call to *.html
 
 Philipp
 
 Am 21.01.2010 um 19:18 schrieb Brian Thompson:
 
  Can you get the Struts filter to execute for static pages?  
 It seems like
  that would fix the Dispatcher.getInstance() problem.  Something like
  
  action name=* class=com.opensymphony.xwork2.ActionSupport
   result name=success/staticHTML/{1}/result
  /action
  
  in your struts.xml seems like it would do the trick (be careful of
  overriding your regular actions!).
  
  -Brian
  
  
  
  On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann 
  philipp.leusm...@rwth-aachen.de wrote:
  
  Sure it would be faster without that stuff, but since I use some
  session-related stuff (user login status etc.) , replacing 
 it with a static
  decorator would not be feasible.
  
  Thanks anyway for your suggestions.
  
  Regards,
  Philipp
  snip
  
 
 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
 
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 Direct contact information for 
affiliates is available at http://www.merck.com/contact/contacts.html) 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: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: decorating static content with sitemesh

2010-01-21 Thread Brian Thompson
In web.xml, make a Struts filter mapping that includes *.html in addition to
*.action.

-Brian


On Thu, Jan 21, 2010 at 1:41 PM, Philipp Leusmann 
philipp.leusm...@rwth-aachen.de wrote:

 Hi Brian,

 that would work, but then I'll have to make a call to
 /staticHTML/page.html.action to access /staticHTML/page.html.
 Would be a workaround, but I still would prefer the call to *.html

 Philipp

 Am 21.01.2010 um 19:18 schrieb Brian Thompson:

  Can you get the Struts filter to execute for static pages?  It seems like
  that would fix the Dispatcher.getInstance() problem.  Something like
 
  action name=* class=com.opensymphony.xwork2.ActionSupport
   result name=success/staticHTML/{1}/result
  /action
 
  in your struts.xml seems like it would do the trick (be careful of
  overriding your regular actions!).
 
  -Brian
 
 
 
  On Thu, Jan 21, 2010 at 11:49 AM, Philipp Leusmann 
  philipp.leusm...@rwth-aachen.de wrote:
 
  Sure it would be faster without that stuff, but since I use some
  session-related stuff (user login status etc.) , replacing it with a
 static
  decorator would not be feasible.
 
  Thanks anyway for your suggestions.
 
  Regards,
  Philipp
  snip
 


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




Re: Where to put bean.xml (spring configuration)?

2010-01-21 Thread Emi Lu

Rafał Krupiński wrote:

On 21.01.2010 16:40, Emi Lu wrote:

Good morning,

Could someone tell me where to put bean.xml (spring configuration)? It
is not shown in the following document

http://www.vaannila.com/spring/spring-ioc-1.html

Thanks a lot!


The proper place for spring beans declaration in webapp is 
/WEB-INF/aplicationContext.xml
but this article doesn't mention how to load this file, so better for 
you to read spring documentation.

At least that part on integration with struts.


Thank you.

Ok, here is my solution for now:

(1) web.xml

   !-- Uncomment/comment this if you need/don't need Spring support --
   context-param
  param-namecontextConfigLocation/param-name
  param-value/WEB-INF/applicationContext*.xml/param-value
   /context-param

   listener 
listener-classorg.springframework.web.context.ContextLoaderListener/listener-class 


   /listener


(2) ApplicationContext.xml

?xml version=1.0 encoding=UTF-8?
beans xmlns=http://www.springframework.org/schema/beans; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd;


   bean id=springQuizMaster 
class=example.action.spring.SpringQuizMaster /bean
   bean id=strutsQuizMaster 
class=example.action.spring.StrutsQuizMaster /bean




   bean id=quizMasterService 
class=example.action.spring.QuizMasterService

  property name=quizMaster ref=springQuizMaster /
   /bean

   bean id=processSpring1 class=example.action.spring.ProcessSpring1
  property name=quizMasterService ref=quizMasterService /
   /bean


/beans


(3) ProcessSpring1.java
public class ProcessSpring1 extends ActionSupport
{

   private QuizMasterService quizMasterService ;
   private String str_result ;


   public String execute()
   {
  System.out.println(quizMasterService.getQuizMaster().popQuestion());
  this.setStr_result(quizMasterService.getQuizMaster().popQuestion());
  return SUCCESS;
   }

   public QuizMasterService getQuizMasterService()
   {
  return quizMasterService;
   }

   public void setQuizMasterService(QuizMasterService quizMasterService)
   {
  this.quizMasterService = quizMasterService;
   }

   public String getStr_result() {
  return str_result;
   }

   public void setStr_result(String str_result) {
  this.str_result = str_result;
   }

}

(4) struts.xml

  action name=ProcessSpring1 
class=example.action.spring.ProcessSpring1

 result name=success/WEB-INF/pages/spring/spring1.jsp/result
  /action


(5) spring1.jsp
%@ page contentType=text/html; charset=UTF-8 %
%@ taglib prefix=s uri=/struts-tags %
Center BSpring Examples1/B/Center
HR

BR/

BSpring result/B: s:property value=str_result / BR/


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



s:text tag question

2010-01-21 Thread bberken

I'm having a problem w/the use of the s:text/ tag in my application. My
setup is the following:

(struts 2.1.8.1)

I have one global resource bundle, defined in my struts.properties file:
struts.custom.i18n.resources=application

in my jsp I am outputting a label as follows:
tds:text name=header.form.videoVideo/s:text/td

the resource key 'header.form.video' is NOT defined in my
application.properties file, thus I expected the default value in the body
of the tags to be displayed : Video

However - I'm getting an empty string displayed, as opposed to my default
text. 

A similar s:text call is made a few lines down in my jsp:
tds:text name=header.form.storiesStories/s:text/td and this does
display correctly (this key is also not defined in my .properties file, but
the default text Stories is displayed)

My action class does have a string property named 'video':
private String video = ;

and it does NOT have a 'stories' property

If I change the default text in my tag to:
tds:text name=header.form.videoVideos/s:text/td, the default text
Videos is displayed, and if I initialize my action class's video property
to some value:
private String video = test; then the string 'test' is displayed in my
jsp.

It seems like struts is somehow evaluating the literal string default in the
body of my s:text tags - to something on the ValueStack (and doing it w/out
case sensitivity).

Am I not understanding the way the resource bundle key resolution works? 

This issue cropped up after an upgrade from struts 2.0.6 to 2.1.8.1 - If
anyone has any insight I'd appreciate it!


-- 
View this message in context: 
http://old.nabble.com/%3Cs%3Atext-tag-question-tp27263681p27263681.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Problem with excel download file from Action (S 2.1.8)

2010-01-21 Thread Oscar Calderon
Hi to all, i wanna ask you a question about downloading files from 
struts action. Actually i'm working on application that has some 
jasperreports, where by default my action prints as PDF, and it works 
fine, but now i'm trying to serve an excel file, so i'm using the next code:


byte[] arrStream = 
reportObj.getXlsReportStream(/reports/repDetalleRecarg.jrxml, parameters);

ServletOutputStream out = servletResponseObj.getOutputStream();
servletResponseObj.setContentType(application/vnd.ms-excel);
out.write(arrStream);
out.flush();
out.close();

Where reportObj is an object from a class that i code to abstract the 
report byte[] generation, so i obtain the byte array, then declare and 
instantiate the object from ServletOutputStream to write the stream, 
then i establish the content type to excel file and finally write the 
stream, but the problem is that works, but in the browser it gives me 
the option to download a file with extension .action, like   
myAction!myMethod.action  , not an excel file, so i have to download it, 
change it's extension to open it.


The code used for pdf generation is almost equal and it works fine,is this:

byte[] arrStream = 
reportObj.getPdfReportStream(/reports/repDetalleRecarg.jrxml, parameters);

ServletOutputStream out = servletResponseObj.getOutputStream();
servletResponseObj.setContentType(application/pdf);
out.write(arrStream);
out.flush();
out.close();

Thanks in advance

--
Oscar Calderon

JAVA Tutorials and How to's? Visit http://www.javahowto.net/


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Problem with excel download file from Action (S 2.1.8)

2010-01-21 Thread Dale Newfield

Oscar Calderon wrote:

a question about downloading files from struts action.


I would suggest using the stream result type rather than 
hand-constructing the servlet response.  In either case, though, you 
want to look into the contentDisposition result parameter.  Probably 
you want a value something like 'attachment;filename=foo.xls'


-Dale

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: validation in struts2

2010-01-21 Thread Shasha

Thanks all.

It was working fine after changing to LoginAction-validation.xml .


musomesa wrote:
 
 
  Also, the file should be LoginAction-validation.xml . Use the
 config-browser to see that you have the validators in place. 
 
  
 
 Chris
  
 
  
 
 -Original Message-
 From: Gabriel Belingueres belingue...@gmail.com
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Wed, Jan 20, 2010 10:12 am
 Subject: Re: validation in struts2
 
 
 the form tag is wrong?
 
 try:
 
 s:form action=doLogin namespace=/tricky
 
 2010/1/19 Shasha sarada.i...@yahoo.com:

 Hi All,

 I am not able to get the validation errors from Login-validation.xml when
 i
 am using Modeldriven .

 Login-validation.xml
   1. !DOCTYPE validators PUBLIC
   2. -//OpenSymphony Group//XWork Validator 1.0.2//EN
   3.
 http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd;
   4.
   5. validators
   6. field name=username
   7. field-validator type=requiredstring
   8. message key=requiredstring/
   9. /field-validator
  10. /field
  11. field name=password
  12. field-validator type=requiredstring
  13. message key=requiredstring/
  14. /field-validator
  15. /field
  16. /validators

 LoginAction.java

   1. public class LoginAction extends ActionSupport implements
 ModelDriven,SessionAware{
   2.
   3. private User user = new User();
   4. private Map session;
   5. private UserDAO userDAO = new UserDAOImpl();
   6.
   7. public String execute() throws Exception {
   8.
   9. boolean success=userDAO.verifyUser(user);
  10. if (success)
  11. return SUCCESS;
  12. else
  13. return ERROR;
  14. }
  15.
  16. public Object getModel() {
  17. return user;
  18. }
  19.
  20. public void setSession(Map session) {
  21. this.session=session;
  22. }
  23.
  24. public Map getSession() {
  25. return session;
  26. }
  27.
  28. }

 login.jsp

   1. %@ taglib prefix=s uri=/struts-tags %
   2. html
   3. head
   4. titleStruts 2 Login Application!/title
   5.
   6. link href=s:url value=/css/main.css/ rel=stylesheet
 type=text/css/
   7.
   8. /head
   9. body
  10. s:form action=doLogin.action method=POST
  11. tr
  12. td colspan=2Login/td
  13. /tr
  14. tr
  15.td colspan=2
  16. s:actionerror /
  17.  s:fielderror /
  18./td
  19. /tr
  20.
  21. s:textfield name=username label=Login name/
  22. s:password name=password label=Password/
  23. s:submit value=Login align=center/
  24.
  25. /s:form
  26.
  27. /body
  28.
  29. /html

 http://old.nabble.com/file/p27236040/error.jpg


 --
 View this message in context:
 http://old.nabble.com/validation-in-struts2-tp27236040p27236040.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org


 
 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org
 
  
 
 

-- 
View this message in context: 
http://old.nabble.com/validation-in-struts2-tp27236040p27266241.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Struts2 :Tiles request page without action class

2010-01-21 Thread Shasha

Hi All,

I am trying to show welcome page using tiles so i am calling to call an
action where the action doesn't exists (since this a feature in struts2) it
thrown an error 

org.apache.tiles.definition.NoSuchDefinitionException: SUCCESS

can any let me know what must be the error.

web.xml 

listener  
 
listener-classorg.apache.struts2.tiles.StrutsTilesListener/listener-class   
/listener 

tiles.xml 

definition name=baseLayout template=pages/layout/baseLayout.jsp
  put-attribute name=title  value=Template/
  put-attribute name=header value=/pages/common/header.jsp/
  put-attribute name=menu   value=/pages/common/menu.jsp/
  put-attribute name=body   value=string/
  put-attribute name=footer   value=/pages/common/footer.jsp/
  /definition
  
  definition name=SUCCESS extends=baseLayout
  put-attribute name=title  value=Template/
  put-attribute name=body   value=/pages/login.jsp/
  /definition

struts.xml 
result-types
result-type name=tiles
class=org.apache.struts2.views.tiles.TilesResult /
/result-types
action name=showLogin
result type=tilesSUCCESS/result
/action


-- 
View this message in context: 
http://old.nabble.com/Struts2-%3ATiles-request-page-without-action-class-tp27266243p27266243.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Specifying a custom type converter for a collection

2010-01-21 Thread Aaron Wieland
I've read documentation that explains how to create a custom type converter, 
and how to apply type conversion to a collection, but nothing that shows how to 
apply a custom type converter to a collection. So far, none of my attempts have 
worked.

My action class has the following field, with the corresponding getter/setter:

   protected ListDevice selectedDevices;

There is a custom converter, DeviceStrutsTypeConverter, that has been used 
successfully to convert a single instance of Device in other contexts. It takes 
a string ID and uses it to load an instance of Device (an interface).

The view includes a select list with a name of selectedDevices. The option 
values are IDs.

In the properties file for the action, I've added:

   Element_selectedDevices=my.package.Device
   CreateIfNull_selectedDevices=true

(I know that the name/path for the properties file is correct.)

I'm not sure how I'm supposed to associate the Device type with its converter. 
Device is an interface, but that shouldn't matter if the converter is used to 
create instances. Adding selectedDevices=my.package.DeviceStrutsTypeConverter 
doesn't make sense (or work) because the converter doesn't apply to the 
collection as a whole. (Incidentally, I tried 
selectedDevices=my.package.DeviceCollectionStrutsConverter, after 
implementing a new converter that was designed to be applied directly to the 
collection, but that didn't work either.) I tried adding 
my.package.Device=my.package.DeviceStrutsConverter, first to the properties 
file for the action, and then to xwork-conversion.properties (newly created in 
the resources folder's root).

In all cases, selectedDevices remains stubbornly null or empty upon submitting 
my edits (it's an edit action; the initial population of data and rendering 
work fine), and the breakpoint in the converter is never reached. The request 
parameters map selectedDevices to an array of string IDs, as expected.

All of which is a long-winded way of asking: How do you specify a custom type 
converter for the elements of a collection? Any tips will be much appreciated.

Thanks,
Aaron


Re: Problem with excel download file from Action (S 2.1.8)

2010-01-21 Thread Oscar
Thanks Dale. I searched a little bit about it and i solve the problem
creating a InputStream field in my action, then adding a stream result type
as you said, like this:

result name=xlsRep type=stream
  param name=contentTypeapplication/vnd.ms-excel/param

  param name=inputNamenameOfInputStreamFieldFromYourAction/param
  param name=contentDispositionfilename=nameoffile.xls/param

  param name=bufferSize1024/param
/result



2010/1/21 Dale Newfield d...@newfield.org

 Oscar Calderon wrote:

 a question about downloading files from struts action.


 I would suggest using the stream result type rather than hand-constructing
 the servlet response.  In either case, though, you want to look into the
 contentDisposition result parameter.  Probably you want a value something
 like 'attachment;filename=foo.xls'

 -Dale


 -
 To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
 For additional commands, e-mail: user-h...@struts.apache.org




-- 
Oscar


Re: The GWT Plugin

2010-01-21 Thread Michael Finney
Hi.

I have a struts 2 application.  I followed the directions at
http://cwiki.apache.org/S2PLUGINS/gwt-plugin.html

I do not see my Struts2FillGwt class's onModuleLoad method getting
called when I go to
http://localhost:8092/struts2Fill/Gwtandstruts2.html  It's not
dynamically populating my   td id=sendButtonContainer/td

It's set up as an entry point.

I wonder if  http://localhost:8092/struts2Fill/Gwtandstruts2.html  is
really the way to enter the struts2/gwt-plugin powered site.

Should it be something like:
http://localhost:/Gwtandstruts2.html?gwt.codesvr=10.0.0.4:9997
and how do I get that gwt.codesvr=?


2009/12/17 Martin Gainty mgai...@hotmail.com:

 the endpoints would have the same class attribute from the action tag e.g.
 action name=Hello class=example.Hello method=hello
 MyServiceAsync service = (MyServiceAsync) GWT.create(MyService.class);
 ServiceDefTarget endpoint = (ServiceDefTarget) service;
 endpoint.setServiceEntryPoint(Hello.action);

 http://cwiki.apache.org/S2PLUGINS/gwt-plugin.html

 Martin Gainty
 independant?
 __
 Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
 sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
 oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
 dem Austausch von Informationen und entfaltet keine rechtliche 
 Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
 wir keine Haftung fuer den Inhalt uebernehmen.
 Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
 destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
 l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
 est interdite. Ce message sert à l'information seulement et n'aura pas 
 n'importe quel effet légalement obligatoire. Étant donné que les email 
 peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
 aucune responsabilité pour le contenu fourni.




 Date: Thu, 17 Dec 2009 16:38:37 +0500
 Subject: The GWT Plugin
 From: saee...@gmail.com
 To: user@struts.apache.org

 I am planning to use GWT in some of my projects, the Struts 2 + GWT Plugin
 looks very good. How do I make it work with Struts on parts of the project,
 will it need multiple entrypoint 's?

 --
 Saeed Iqbal
 Independant Consultant
 J2EE - Application Architect / Developer

 _
 Hotmail: Trusted email with powerful SPAM protection.
 http://clk.atdmt.com/GBL/go/177141665/direct/01/



-- 
Michael Finney - Always Striving To Serve You Better Every Day
http://www.SmilingSoftwareSolutions.com

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Hiding URL in struts1.2

2010-01-21 Thread Nikhil Walvekar
Hi Zaheer,

I would like to understand requirement of hiding actual URL.

Shomehow actual URL should be known to your browser otherwise it wont be
able to send server request.
If user is not going to do view source and check whats there in HTML then
prob you can use frames or if you want to hide your server or webapp then
you can try using apache fronting. But the solution will depend on the
reason why you want to hide the URL.

But as Brian said user will not be able to bookmark your site pages.

Regards,
Nikhil

On Thu, Jan 21, 2010 at 8:08 PM, Brian Thompson elephant...@gmail.comwrote:

 You'll have to communicate the parameters *somehow*, whether that's using
 POST for all your requests (but that's bad form when your requests are
 simply looking up data in the database), exposing the full url, or mapping
 parameters to url path elements.

 I suppose you could also write the front-end to do everything with Ajax
 calls, but I'd advise against it.  Such sites are annoying to end-users.
 Imagine going to Amazon, bookmarking a product, then going back to the
 bookmark the next day...and it takes you to the homepage!  Not very
 user-friendly.

 However you resolve this, please make a follow-up post to the list.  I'm
 curious to see how you handle this issue.

 -Brian



 On Thu, Jan 21, 2010 at 12:09 AM, Zaheer Mohammad
 zaheer.cse4...@gmail.comwrote:

  HI,
   Thanks to all for your valuable sugestions
 
Actually i want to hide all parameters form the Url
 
  actual Url's are like this :
 
 
 
 http://localhost:8280/mspui/custumerAuthrtn.do?dispmethd=custumerAuthorizeaccountNumber=12345
 
  but I should get
 
 
  http://localhost:8280/mspui/
 
  by hiding parameters in the url.
 
  this is  already developed project and this is a enhancement. using post
  means i have to change much of code.is there any simple alternative  way
  of
  acheiving this.
 
 
  Thanks in Advance
 
  Zaheer Mohammad
 
  On Thu, Jan 21, 2010 at 9:47 AM, Raghuveer raghuve...@infotechsw.com
  wrote:
 
   Could you elaborate your requirement?
   URL will be changed when you use
  
   action name= loginv 
   class=com.test.actions.LoginAction 
   !-- Home --
  result name=app_home_action type=redirectAction
  showHome
  /result
   /action
   action name= showHome  class=com.utc.pw.spanas.actions.CHome
   /action
-Original Message-
   From: Brian Thompson [mailto:elephant...@gmail.com]
   Sent: Wednesday, January 20, 2010 9:13 PM
   To: Struts Users Mailing List
   Subject: Re: Hiding URL in struts1.2
  
   I would look into using URLRewrite [1].  It would be easy to go from
   showing
   this in the browser:
  
   http://localhost:8180/webproject/showHome
  
   to the application processing this:
  
   http://localhost:8180/webproject/loginv.do?dispmethd=showHome
  
  
  
  
   [1] - http://tuckey.org/urlrewrite/
  
   On Wed, Jan 20, 2010 at 5:23 AM, chen thomas thomasche...@gmail.com
   wrote:
  
Maybe you could use post method of Form to do this
   
  
  
   -
   To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
   For additional commands, e-mail: user-h...@struts.apache.org
  
  
 




-- 
Nikhil


Struts2 Rest Plugin + crossdomain.xml

2010-01-21 Thread Brian Ferris
I've been using struts2 + the rest plugin successfully to create a simple
rest api web service.  I'd like to make that service accessible to Flash and
Silverlight clients, which means I need to add a crossdomain.xml access file
at the root of my webapp.  Normally I would just copy a crossdomain.xml file
into the root of my webapp and serve it as a static file.

However, this doesn't seem to work with the rest plugin, as it attempt to
map the request for /crossdomain.xml to an action named CrossdomainAction
action (its index() method specifically).  Ok, so I create a
CrossdomainAction class which just has an index() method that returns
success.  Except now, the request returns the action object serialized as
xml, which isn't what I want either.

Is there an easier way to do this that I'm missing?

The solution I've finally ended up with is to define a custom result with a
name of success-xml, since the rest interceptor will check for a result
with that name.  Of course, if I attempt to set my result location to
crossdomain.xml, it throws an exception on startup because the Convention
plugin doesn't know how to handle results with an extension of xml.  So I
ended up renaming my crossdomain.xml file to crossdomain.html and
writing a custom Result that sets the contentType to text/xml and includes
the crossdomain file.  Pretty convoluted... surely there is something
better?

I'm using struts-2.1.18.1

Thanks,
Brian