Re: inheritance...

2008-04-28 Thread Antonio Petrelli
2008/4/27 balaji.m.cs [EMAIL PROTECTED]:
 BaseFrom extends ActionForm {

   private List myList = null;
  }

 ChildForm extends BaseForm

ChildForm is also BaseForm, it's OOP inheritance, so I don't see the
problem here.

Antonio

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



Re: Struts2 Unit Testing

2008-04-28 Thread Nils-Helge Garli Hegvik
This is a really big question. Just having unit tests does not
necessarily mean that your code is any better. Writing good unit tests
is an art (for any code, not just Struts 2), and is hard to summarize
in a few lines. A good book would be a good place to start. I haven't
read too many books on the subject, but I liked Pragmatic Unit
Testing in Java with JUnit [1].

I'm by no means a unit testing expert, but here's a few lessons
learned from my own experience:

- When writing tests for existing code, try not to look at the code
you're writing tests for while writing the test. Instead, think of
what the code should do for a set of given inputs, and write tests
that ensure that the result is as expected.
- Use mock frameworks with care. When used correct, it is a good tool
to isolate boundaries and make it possible to test units in isolation.
When used wrong, you end up with fragile tests that is testing what
your code does, instead of testing what your code should do.
- Don't get caught up in the code coverage hysteria. Focus on writing
good tests instead of how many lines and branches of code you have
tested.
- Your test code is a part of your production system, so treat it like
that. When the test code gets messy, refactor it and keep it on the
same level of quality as the rest of your production code.

Also, as Jeromy pointed out in another reply, set up a continuous
build system so your tests are running all the time.

But most of all, experience is important. So jump into it and start
writing some tests.

Good luck on your testing.

Nils-H

[1] - http://pragprog.com/titles/utj/pragmatic-unit-testing-in-java-with-junit


On Sun, Apr 27, 2008 at 2:41 PM, Frans Thamura [EMAIL PROTECTED] wrote:
 hi there,

  i just have several question around unit testing for our project, cimande

  and we have lack of skill to to unit testing for our core (cimande), and our
  apps on cimande (postila, papaje, takatu, etc).

  anyone can share?

  how to start a good unit testing for Struts2 based application, so our code
  is good

  F


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



RE: Struts 2 - Where does all the CPU go

2008-04-28 Thread Matthew Seaborn
Where are certainly a number of calls through to OGNL within the Freemarker 
code, so it could still be that.

Unfortunately, I have already

constant name=struts.freemarker.templatesCache value=true /

in my struts.xml

I don't see the WARNings you mention in my logs.

-Original Message-
From: Jeromy Evans [mailto:[EMAIL PROTECTED]
Sent: 27 April 2008 04:54
To: Struts Users Mailing List
Subject: Re: Struts 2 - Where does all the CPU go

Hi Matthew,

I'm surprised  that you can contribute more to FreeMarker than to than
Ognl. Perhaps FreeMarker is still masking the underlying problem as the
templates predominately call into the model setup by Struts and most of
that model is prepared via OGNL expressions.  OGNL does cache
expressions though and you would be reusing many of them.

Turn on freemarker template caching.  This is a cache within struts2,
rather than FreeMarker's own cache, that reuses the Template object
keyed by name rather than going to the template loader.

in struts.properties:
struts.freemarker.templatesCache=true

1.5 seconds within the template rendering is still huge though, even
with freemarker caching turned off. One of the templates must be calling
*something* slow in the struts 2 model.

I've always suspected that the guys below were eating up my cycles.

2008-04-27 13:26:58,413 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [org.apache.tiles.AttributeContext.STACK]
2008-04-27 13:26:58,414 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [org.apache.tiles.AttributeContext.STACK]
2008-04-27 13:26:58,414 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [org.apache.catalina.jsp_file]
2008-04-27 13:26:58,851 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [templateDir]
2008-04-27 13:26:58,852 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [templateDir]
2008-04-27 13:26:58,852 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [theme]
2008-04-27 13:26:58,853 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [theme]
2008-04-27 13:26:58,854 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [templateDir]
2008-04-27 13:26:58,854 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [templateDir]
2008-04-27 13:26:58,869 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [theme]
2008-04-27 13:26:58,870 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [theme]
2008-04-27 13:26:58,878 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [.freemarker.Request]
2008-04-27 13:26:58,878 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [.freemarker.RequestParameters]
2008-04-27 13:26:58,880 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [commands]
2008-04-27 13:26:59,036 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [property]
2008-04-27 13:26:59,044 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [property]
2008-04-27 13:26:59,074 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [templateDir]
2008-04-27 13:26:59,074 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [templateDir]
2008-04-27 13:26:59,074 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [theme]
2008-04-27 13:26:59,074 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [theme]
2008-04-27 13:26:59,076 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [templateDir]
2008-04-27 13:26:59,077 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [templateDir]
2008-04-27 13:26:59,077 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [theme]
2008-04-27 13:26:59,077 WARN  [http-8080-Processor24] [OgnlValueStack]
Could not find property [theme]




CONFIDENTIALITY - This email and any files transmitted with it, are 
confidential, may be legally privileged and are intended solely for the use of 
the individual or entity to whom they are addressed. If this has come to you in 
error, you must not copy, distribute, disclose or use any of the information it 
contains. Please notify the sender immediately and delete them from your system.

SECURITY - Please be aware that communication by email, by its very nature, is 
not 100% secure and by communicating with Perform Group by email you consent to 
us monitoring and reading any such correspondence.

VIRUSES - Although this email message has been scanned for the presence of 
computer viruses, the sender accepts no liability for any damage sustained as a 
result of a computer virus and it is the recipient’s responsibility to ensure 
that email is virus free.

AUTHORITY - Any views or opinions expressed in this email are solely those of 
the 

datetimepickers

2008-04-28 Thread Alan Nisbet

Hi,

I'm trying to capture date and time from a datetimepicker, so I want the 
date object to contain both date and time. Has anyone come up with a 
decent solution on how to do this?


I would have thought it was a relatively common thing to try and do!

Best Regards,

Alan.

--
--
Alan Nisbet Phone: +44(0)1355 272911
Software EngineerFax:   +44(0)1355 272993
Ecebs Limited
The Toros Building,
Rankin Avenue
Scottish Enterprise Technology Park,
East Kilbride
G75 0QF  Email: [EMAIL PROTECTED]
United Kingdom   Internet:  http://www.Ecebs.com

This email is only for the use of the addressee.  It may contain
information which is legally privileged, confidential and exempt
from disclosure.  If you are not the intended recipient you are
hereby notified that any dissemination, distribution, or copying
of this communication and its attachments is strictly prohibited.
-- 



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



Re: migration from struts 1 to 2

2008-04-28 Thread KonTiki

Yes.
In fact, the Actions are POJO's only if they do not extend the ActionSupport
class and dont get hooked into the framework statically. 

An excellent (meaning precise and sweet) introduction to this migration
scenario is here by Ian Roughley:
http://www.infoq.com/news/2006/12/struts-migration
(unfortunately the pages dont link forward, so this is actually part 3).


newton.dave wrote:
 
 Just some clarifications.
 
 4.   Action Classes
 b) Make your Action class to extend ActionSupport, instead of Action.
 While
 this is not mandatory, it is beneficial to do so because then any POJO
 can
 be used as an Action Object. Further we then will have access to
 predefined
 tokens such as SUCCESS and ERROR.
 
 The reason to extend ActionSupport is to get the default implementations
 of
 things like validation and I18N support. Actions are POJOs without
 extending
 ActionSupport.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/migration-from-struts-1-to-2-tp16819256p16933348.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: Is there such a thing as flash in S2?

2008-04-28 Thread KonTiki


Brad A Cupit wrote:
 
 Having said that, I question using the session, since
 redirect-after-post was designed to help alleviate back and refresh
 button problems. If we store information in the session for the
 redirect, then the first GET will find that information, but subsequent
 GETs (perhaps the result of pressing back or refresh) will not find that
 information, so the GET will have been inconsistent.
 

Precisely. Using the session to store data across a redirect does indeed
lead to a misbehaving GET.
More importantly, IMHO the need to preserve data this way indicates a design
flaw - Redirect was designed to use GET and there are always (perhaps,
not-so-easy) alternatives to keep it that way.

That said, one occasion when I was forced into using the session this way
was when I wrote a custom solution to redirect across HTTP and HTTPS (like
when a secure resource is accessed via HTTP) for Struts, working very
similar to the SSL plugin.
-- 
View this message in context: 
http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p16935302.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Redirect-action parameters via POST

2008-04-28 Thread KonTiki


Here are some tests which seemed to have worked with really long URL's.
Such as 2K in IE and upto 100,000 characters in Firefox.

http://www.boutell.com/newfaq/misc/urllength.html



newton.dave wrote:
 
 --- ancatdubher [EMAIL PROTECTED] wrote:
 (Also, the URL is limited to 256 characters length).
 
 I've never noticed that limitation; I haven't seen a mainstream browser
 that
 wouldn't accept or send anything much less than about 2K, and some will do
 twice that.
 
 Dave
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Redirect-action-parameters-via-POST-tp16884951p16935375.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Url tag and automatic parameter setting

2008-04-28 Thread Jukka Välimaa
Hi,

I have a problem--more of an annoyance, really--with struts s:url tag. It
adds parameters into the result url without my say-so and I don't really
understand on what grounds. For example, I had the following in my jsp page:
s:url id=addNewContract action=ajaxEditContract
s:param name=decorate value=false /
/s:url

It evaluated to this:
ajaxEditContract.html?id=-3amp;amp;decorate=falseamp;amp;dojo.preventCache=1209372598206amp;amp;committerId=-7
amp;dojo.preventCache=1209372600172amp;decorate=false

I can understand it adds the ajax stuff automatically (although I don't know
why and when). What I don't understand is, why does it add committerId and
id as parameters. Both are available via getters in my action, and
committerId is used in the form that comes after I define the url. Id,
however, is not used at all in the page. To avoid problems, I have to create
the url like this:

s:url id=addNewContract action=ajaxEditContract
s:param name=decorate value=false /
s:param name=id value=null /
/s:url


To avoid problems in the future, I'd like to understand why exactly does the
url tag behave like this. I understand includeParams attribute is used to
set how the tag behaves with parameters, but there is no explanation in the
tag reference what all and get are supposed to do.

Can anyone tell me why does the url tag behave the way it does, or where I
could find an explanation?


Re: Struts1 and Struts2 in the same app

2008-04-28 Thread KonTiki

Hi Sandy,

How exactly did you do the struts.xml inclusion?
(I had a similar problem, where I found the struts.xml for struts 2 wasn't
picking the correct xml)
And by java source folder - do you mean WEB-INF/classes/  ?


Sandy143 wrote:
 
 I  have to integrate struts 2 actions in my existing struts 1.2 web
 application.
 
 My login page is using struts 1.2 action. Upon login, I come to home page.
 there is a link on home page. when I click on that link, I need to go to
 another jsp page. The later action has to be in struts 2. 
 
 I have added filter, filter mapping for struts 2 in web.xml.
 
 I have included struts.xml in the root of the project (under java source
 folder). This included struts-config.xml (using struts 1.2.8) and
 struts-config-two.xml (using struts 2). 
 
  -- struts-config.xml is in web-inf
 
 -- struts-config-two.xml is in the root of the project (under java source
 folder)
 
  my  struts-config-two.xml is :
 
 -
 ?xml version=1.0 encoding=UTF-8 ?
 
 !DOCTYPE struts PUBLIC
 
 -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
 
 http://struts.apache.org/dtds/struts-2.0.dtd;
 
  struts
 package name=xxx namespace=/xxx extends=xxx-default
 
 action name=testAction2 

 class=x.y.z.presentation.test.TestAction2
  result name=home /TestLink.jsp /result
 /action
 
 /package
 /struts
 
 
 --
 
 In my TestLink.jsp, I am specifying :
 
 s:url id=viewURL namespace=/xxx action=testAction2 / 
 
 s:a href=%{viewURL} Test Link Home /s:a Test Link
 
 
 -
 
 I am able to login to the app. but When I click on the link I get an error
 message : ERROR action.RequestProcessor  - Invalid path was requested
 /xxx/TestAction.
 
 Can you please help me to resolve this issue.
 
  I would have to use struts2 action in the flow of struts1 action. Please
 let me know the step by step procedure. Can anyone provide a sample app or
 config info on how it can be done?
 
 I have read the migration tutorial. but it didn't help me to resolve this
 issue.
 
  
 
  
 
  
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts1-and-Struts2-in-the-same-app-tp16851031p16935666.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Main differences between Struts 1 and Struts 2

2008-04-28 Thread Fernandes Celinio SGCF
Hi,
Can anyone tell me what are the main differences between Struts 1 and
Struts 2 ?
Or point me to links describing them.

What was added in version 2 ?

Thanks !

===

Ce message et toutes les pieces jointes (ci-apres le message) 
sont confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite. 
Tout message electronique est susceptible d'alteration. 
La SOCIETE GENERALE et ses filiales declinent toute responsabilite
au titre de ce message s'il a ete altere, deforme ou falsifie.
 
===

This message and any attachments (the message) are confidential
and intended solely for the addressees.
Any unauthorized use or dissemination is prohibited. 
E-mails are susceptible to alteration.   
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates
shall be liable for the message if altered, changed or falsified. 

===

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



Re: Main differences between Struts 1 and Struts 2

2008-04-28 Thread Antonio Petrelli
2008/4/28 Fernandes Celinio SGCF [EMAIL PROTECTED]:
  Can anyone tell me what are the main differences between Struts 1 and
  Struts 2 ?

It's faster to say what they have in common:
they both are MVC implementations;
they both are under the Apache umbrella.

The end :-)
Antonio

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



Re: Main differences between Struts 1 and Struts 2

2008-04-28 Thread Nils-Helge Garli Hegvik
http://struts.apache.org/2.x/docs/comparing-struts-1-and-2.html

Nils-H

On Mon, Apr 28, 2008 at 1:33 PM, Fernandes Celinio SGCF
[EMAIL PROTECTED] wrote:
 Hi,
  Can anyone tell me what are the main differences between Struts 1 and
  Struts 2 ?
  Or point me to links describing them.

  What was added in version 2 ?

  Thanks !

  ===

  Ce message et toutes les pieces jointes (ci-apres le message)
  sont confidentiels et etablis a l'intention exclusive de ses destinataires.
  Toute utilisation ou diffusion non autorisee est interdite.
  Tout message electronique est susceptible d'alteration.
  La SOCIETE GENERALE et ses filiales declinent toute responsabilite
  au titre de ce message s'il a ete altere, deforme ou falsifie.

  ===

  This message and any attachments (the message) are confidential
  and intended solely for the addressees.
  Any unauthorized use or dissemination is prohibited.
  E-mails are susceptible to alteration.
  Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates
  shall be liable for the message if altered, changed or falsified.

  ===

  -
  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: Main differences between Struts 1 and Struts 2

2008-04-28 Thread KonTiki

:-)

This article should help: 
http://www.infoq.com/news/2006/12/struts-migration


Antonio Petrelli-3 wrote:
 
 2008/4/28 Fernandes Celinio SGCF [EMAIL PROTECTED]:
  Can anyone tell me what are the main differences between Struts 1 and
  Struts 2 ?
 
 It's faster to say what they have in common:
 they both are MVC implementations;
 they both are under the Apache umbrella.
 
 The end :-)
 Antonio
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Main-differences-between-Struts-1-and-Struts-2-tp16937092p16937367.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Passing parameters to ftl template with s:param

2008-04-28 Thread Alan Nisbet

Hi,

In case anyone is interested

s:param tag only works(for me) when value is defined in body of tag and 
not in value attribute


s:param name=date value=fromDate / doesn't work
s:param name=datefromDate/s:param does work

Alan Nisbet wrote:

Hi,

First time poster and relative struts newbie,

I'm trying to create an ftl template that positions two 
s:datetimepicker(s) side by side to capture date and time.


I use the s:component tag and define my template shown below. It is 
working relatively well however I'm unable to retrieve any parameters 
via the ${parameters.myParam} notation (only defaults are being set). 
In my JSP I'm using s:param tag to define the parameters.


Can anyone help me?


dateandtime.ftl
---

#include 
/${parameters.templateDir}/${parameters.theme}/controlheader.ftl /


@s.dateTimePicker
   theme=simple
   name=${parameters.dateName?default('fromDate')}
   type=date
   displayFormat=${parameters.dateFormat?default('dd/MM/')} /

nbsp;

nbsp;

@s.dateTimePicker
   theme=simple
   name=${parameters.timeName?default('startTime')}
   type=time
   displayFormat=${parameters.dateFormat?default('HH:mm')} /

#include /${parameters.templateDir}/xhtml/controlfooter.ftl /
**

Best Regards,

Alan.



Best Regards,

Alan.

--
--
Alan Nisbet Phone: +44(0)1355 272911
Software EngineerFax:   +44(0)1355 272993
Ecebs Limited
The Toros Building,
Rankin Avenue
Scottish Enterprise Technology Park,
East Kilbride
G75 0QF  Email: [EMAIL PROTECTED]
United Kingdom   Internet:  http://www.Ecebs.com

This email is only for the use of the addressee.  It may contain
information which is legally privileged, confidential and exempt
from disclosure.  If you are not the intended recipient you are
hereby notified that any dissemination, distribution, or copying
of this communication and its attachments is strictly prohibited.
-- 



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



Re: Passing parameters to ftl template with s:param

2008-04-28 Thread Peter Wages
If you want  to  use the value parameter, you must  enclose  the value
 with single quotation marks in addition to  double quotation marks. ,
if  your value is  a string

 ' value ' 
The value  parameter is  assuming you are passing  an object.  This is
associated with OGNL

What worked for you Alan, putting the  value in the body of the tag,
is  good .  This is the simplest way. Here Struts is assuming you are
working with a string.

I  spent a day with this problem.  This is noted the param docs

On 4/28/08, Alan Nisbet [EMAIL PROTECTED] wrote:
 Hi,

 In case anyone is interested

 s:param tag only works(for me) when value is defined in body of tag and not
 in value attribute

 s:param name=date value=fromDate / doesn't work
 s:param name=datefromDate/s:param does work


 Alan Nisbet wrote:
  Hi,
 
  First time poster and relative struts newbie,
 
  I'm trying to create an ftl template that positions two
 s:datetimepicker(s) side by side to capture date and time.
 
  I use the s:component tag and define my template shown below. It is
 working relatively well however I'm unable to retrieve any parameters via
 the ${parameters.myParam} notation (only defaults are being set). In my JSP
 I'm using s:param tag to define the parameters.
 
  Can anyone help me?
 
 
 
  dateandtime.ftl
  ---
 
  #include
 /${parameters.templateDir}/${parameters.theme}/controlheader.ftl
 /
 
  @s.dateTimePicker
theme=simple
name=${parameters.dateName?default('fromDate')}
type=date
 
 displayFormat=${parameters.dateFormat?default('dd/MM/')}
 /
 
  nbsp;
 
  nbsp;
 
  @s.dateTimePicker
theme=simple
name=${parameters.timeName?default('startTime')}
type=time
 
 displayFormat=${parameters.dateFormat?default('HH:mm')}
 /
 
  #include
 /${parameters.templateDir}/xhtml/controlfooter.ftl /
  **
 
  Best Regards,
 
  Alan.
 
 

 Best Regards,

 Alan.

 --
 --
 Alan Nisbet Phone: +44(0)1355 272911
 Software EngineerFax:   +44(0)1355 272993
 Ecebs Limited
 The Toros Building,
 Rankin Avenue
 Scottish Enterprise Technology Park,
 East Kilbride
 G75 0QF  Email: [EMAIL PROTECTED]
 United Kingdom   Internet:  http://www.Ecebs.com

 This email is only for the use of the addressee.  It may contain
 information which is legally privileged, confidential and exempt
 from disclosure.  If you are not the intended recipient you are
 hereby notified that any dissemination, distribution, or copying
 of this communication and its attachments is strictly prohibited.
 --

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




-- 
Peter

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



Struts 2 ResourceBundle Class

2008-04-28 Thread Asleson, Ryan
 
Hello,
 
I am new to Struts 2.
 
Our application uses a custom database-backed ResourceBundle.  I see
that in Struts 2, resource bundle files can be specified using the
struts.custom.i18n.resources property.  
 
Since we aren't sung resource bundle files, how can I specify the class
of our custom ResourceBundle?
 
Thanks!!
 
-Ryan
 
 

This e-mail message is being sent solely for use by the intended recipient(s) 
and may contain confidential information.  Any unauthorized review, use, 
disclosure or distribution is prohibited.  If you are not the intended 
recipient, please contact the sender by phone or reply by e-mail, delete the 
original message and destroy all copies. Thank you.

Struts 2 s:select tag : Unable to retrieve the value in the action

2008-04-28 Thread Binu John

Hi,
I am trying to use the select tag and somehow it does not work as expected.
I am populating a Map with the desired values and using that Map object in the 
select tag.

- Start JSP -
s:select value=selectKeyword theme=simple key=selectKeyword 
id=selectKeyword name=selectKeyword list=selectKeyword 
multiple=true/s:select
- End JSP -

- Start Action Code -
private Map selectKeyword = new HashMap();
public void setSelectKeyword(Map selectKeyword) {
log.debug(LoginAction.class.getName() + : execute() : HERE AFASDFSD);
this.selectKeyword = selectKeyword;
}
public Map getSelectKeyword() {
return selectKeyword;
}

public String execute()
{
selectKeyword = populateHashMap();
return SUCCESS;
}
/* This gets called when I submit the form */
public String saveKeyword()
{
System.out.println(This prints size as 0 :  + selectKeyword.size());
}
- End Action Code -

I am able to view the populated list box but when I try to retrieve the value 
back in my code, I am not getting any value.

Any idea where I am going wrong?

Binu John
Programmer Analyst,
Infosys Technologies Limited, Pune
Mobile # +919823019001


 CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***

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



Simplified usage of:@com.company.Constants.StaticCOnstants

2008-04-28 Thread ravi_eze

hi,

we want to access the constants in our jsp page. So we are proceeding as
follows:

 s:text field name=[EMAIL PROTECTED]@STATIC_CONSTANTS1] /

the problem with this is that we need to repeat the @com.company.Constants
always. So is there a simple way to get this working? I wanted to try out
S:bean and s:Push... but no luck... 

please help.

cheers,
ravi 


-- 
View this message in context: 
http://www.nabble.com/Simplified-usage-of%3A%40com.company.Constants.StaticCOnstants-tp16941171p16941171.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts2 Unit Testing

2008-04-28 Thread Adam Hardy

Nils-Helge Garli Hegvik on 28/04/08 09:02, wrote:

- Don't get caught up in the code coverage hysteria. Focus on writing
good tests instead of how many lines and branches of code you have
tested.


I've no idea what level of code coverage Nils holds to be hysterical, but I 
wouldn't take his advice to mean you should avoid code coverage analysis.


It's free (at least with cobertura in maven) and it's not time consuming to set 
up and it's not too difficult to understand.


You just need to find the right point on the curve of diminishing returns, at 
least the right point for you.


Code coverage reporting is a good tool to have.


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



Re: Struts1 and Struts2 in the same app

2008-04-28 Thread Sandy143

In struts.xml, I have

-
include file=/WEB-INF/struts-config.xml /
include file=/struts-config-two.xml / 
-
yes! struts.xml is placed in WEB-INF/classes/  

Do you have any solution for it?



KonTiki wrote:
 
 Hi Sandy,
 
 How exactly did you do the struts.xml inclusion?
 (I had a similar problem, where I found the struts.xml for struts 2 wasn't
 picking the correct xml)
 And by java source folder - do you mean WEB-INF/classes/  ?
 
 
 Sandy143 wrote:
 
 I  have to integrate struts 2 actions in my existing struts 1.2 web
 application.
 
 My login page is using struts 1.2 action. Upon login, I come to home
 page. there is a link on home page. when I click on that link, I need to
 go to another jsp page. The later action has to be in struts 2. 
 
 I have added filter, filter mapping for struts 2 in web.xml.
 
 I have included struts.xml in the root of the project (under java source
 folder). This included struts-config.xml (using struts 1.2.8) and
 struts-config-two.xml (using struts 2). 
 
  -- struts-config.xml is in web-inf
 
 -- struts-config-two.xml is in the root of the project (under java
 source folder)
 
  my  struts-config-two.xml is :
 
 -
 ?xml version=1.0 encoding=UTF-8 ?
 
 !DOCTYPE struts PUBLIC
 
 -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
 
 http://struts.apache.org/dtds/struts-2.0.dtd;
 
  struts
 package name=xxx namespace=/xxx extends=xxx-default
 
 action name=testAction2 

 class=x.y.z.presentation.test.TestAction2
  result name=home /TestLink.jsp /result
 /action
 
 /package
 /struts
 
 
 --
 
 In my TestLink.jsp, I am specifying :
 
 s:url id=viewURL namespace=/xxx action=testAction2 / 
 
 s:a href=%{viewURL} Test Link Home /s:a Test Link
 
 
 -
 
 I am able to login to the app. but When I click on the link I get an
 error message : ERROR action.RequestProcessor  - Invalid path was
 requested /xxx/TestAction.
 
 Can you please help me to resolve this issue.
 
  I would have to use struts2 action in the flow of struts1 action. Please
 let me know the step by step procedure. Can anyone provide a sample app
 or config info on how it can be done?
 
 I have read the migration tutorial. but it didn't help me to resolve this
 issue.
 
  
 
  
 
  
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts1-and-Struts2-in-the-same-app-tp16851031p16942822.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: Struts 2 ResourceBundle Class

2008-04-28 Thread Asleson, Ryan

OK, I answered my own question.  Apparently I can use the
struts.custom.i18n.resources property and specify the fully-qualified
class name of our custom ResourceBundle.
 

-Original Message-
From: Asleson, Ryan [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 28, 2008 9:54 AM
To: user@struts.apache.org
Subject: Struts 2 ResourceBundle Class

 
Hello,
 
I am new to Struts 2.
 
Our application uses a custom database-backed ResourceBundle.  I see
that in Struts 2, resource bundle files can be specified using the
struts.custom.i18n.resources property.  
 
Since we aren't sung resource bundle files, how can I specify the class
of our custom ResourceBundle?
 
Thanks!!
 
-Ryan
 
 

This e-mail message is being sent solely for use by the intended
recipient(s) and may contain confidential information.  Any unauthorized
review, use, disclosure or distribution is prohibited.  If you are not
the intended recipient, please contact the sender by phone or reply by
e-mail, delete the original message and destroy all copies. Thank you.

This e-mail message is being sent solely for use by the intended recipient(s) 
and may contain confidential information.  Any unauthorized review, use, 
disclosure or distribution is prohibited.  If you are not the intended 
recipient, please contact the sender by phone or reply by e-mail, delete the 
original message and destroy all copies. Thank you.

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



Re: [struts] params and staticParams

2008-04-28 Thread Steve Sether
I can't seem to find any indication where this ever wound up from 
several months ago, but I found the same issue independently after 
making the (poor) assumption that a statically assigned parameter 
wouldn't be overridden by a request parameter.  I did some searching and 
found this thread.


Like Dale, I've made the same fix in my default interceptor stack and 
fixed this.


To me, this is a potential security issue.  It's very handy to define a 
parameter passed into the action via the action configuration.  It's 
easy to make the assumption that these parameters can't be overwritten 
by the user.  It seems to me the framework should by default be 
configured with security in mind.


So, can anyone tell me where this wound up?  I'd just like to add my 
voice requesting the default order be changed.


Dale Newfield wrote:

Dale Newfield wrote:

Jeromy Evans wrote:
Wouldn't it be the case for most people that specify params in the 
action definition that they wouldn't want those overridden by

request params?

I don't know the history but I think you make a good point.


It a couple more people agree I'll create a JIRA issue and post a patch.


Clearly that should have started If a couple...

-Dale

-
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: Struts2 Unit Testing

2008-04-28 Thread Nils-Helge Garli Hegvik

  - Don't get caught up in the code coverage hysteria. Focus on writing
  good tests instead of how many lines and branches of code you have
  tested.
 

  I've no idea what level of code coverage Nils holds to be hysterical, but I
 wouldn't take his advice to mean you should avoid code coverage analysis.


What I meant is that it can easily be misused. Code coverage is a nice
tool for guidance, to identify areas that needs improvement - I use
them myself too. But it's easy to get caught up in the idea of
increasing the coverage percentage just to increase the percentage of
coverage, if you understand what I mean. I don't think looking at a
coverage report and write a test just to cover that one line of code
will necessarily lead to a better tested code base. As long as you
focus on writing good tests, coverage will naturally become better.

Nils-H

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



Re: migration from struts 1 to 2

2008-04-28 Thread Sandy143

Hello,

Can't we have the existing struts1 actions and struts2 actions in the same
application?

I want to retain my existing web app which is using struts 1.2.8 and tiles
1.1

The new module in the same webapp, I would like to develop using struts2 .

Please let me know if this is something that is possible or not?

Thanks,
Sandy


sukritthareja wrote:
 
 Here are the steps for Migrating from Struts 1 to Struts 2. You are
 required to make changes in the below mentioned layers”
 
 
 1.JARs
 
 - Add Struts 2 JARs in WEB-INF/lib
 
 
 2.web.xml
 
   - Add following elements to web.xml
 ?xml version=1.0 encoding=UTF-8?
 web-app id=WebApp_ID version=2.4
   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 
 filter
 filter-namestruts2/filter-name
 filter-class org.apache.struts2.dispatcher.FilterDispatcher
 /filter-class
 /filter
 
 filter-mapping
 filter-namestruts2/filter-name
 url-pattern/*/url-pattern
 /filter-mapping
 
 listener
 listener-class
org.springframework.web.context.ContextLoaderListener
 /listener-class
 /listener
 
   
 /web-app
 
 3.struts-config.xml
 
   - Rename “struts-config.xml” to “struts.xml”. Technically, this file in
 Struts 2 is   more streamlined.  
 
   A typical struts-config.xml file of Struts 1 looks like
 ?xml version=1.0 encoding=ISO-8859-1 ?
 !DOCTYPE struts-config PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 1.3//EN
 http://struts.apache.org/dtds/struts-config_1_3.dtd 
 
 struts-config
 
 form-beans
   form-bean name=MyClassForm type=forms.MyClassForm
   /form-bean
 /form-beans
 
   action-mappings
 action path=/MyClass name=MyClassFormtype=actions.MyClassAction 
 validate=false
forward name=success path=/Index.jsp/
   /action
   /action-mappings
 
   message-resources parameter=resources/
 
 /struts-config
 
 - Perform the following actions:
 
 
 
 a)Replace DTD
 b)Replace struts-config tag with struts
 c)Include include file=struts-default.xml/
 d)Remove the form-beans element
 e)Change action-mappings to package name=hello-default
 extends=struts-default
 f)Update each action element by
 - Removing from action element, the “name” attribute.
 - Changing the action “path” attribute to “name”
 - Changing the action “type” attribute to “class”
 - Changing the forward element into a return element
 
The new struts.xml now looks like
 
 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
 http://struts.apache.org/dtds/struts-2.0.dtd 
 
 struts
 
 include file=struts-default.xml/
 
 package name=hello-default extends=struts-default
 
 action name=MyClass class=actions.MyClass
 result/Index.jsp/result
 /action
 
 /package
 
 /struts
 
 4.Action Classes
 
 A typical ActionForm class in Struts 1 looks like
 
 import org.apache.struts.action.ActionForm;
 
 public class MyClassForm extends ValidatorForm {
 
   private String field1;
 
   public String getField1() {
   return field1;
   }
 
   public void setField1(String field1) {
   this.field1 = field1;
   }
 
 }
 
 A typical Action class in Struts 1 looks like
 
 import javax.servlet.http.*;
 import org.apache.struts.action.*;
 public class MyClassAction extends Action {
 
   public ActionForward execute(
   ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
   throws Exception {
 
   MyClassForm input = (MyClassForm) form;
   input.setField1(“Hello”);
   return mapping.findForward(“success”);
   }
   
 }
 
 a) Copy all the properties from the ActionForm class to the Action class,
 and remove the ActionForm class object completely. There is no ActionForm
 in Struts-2.
 
 b) Make your Action class to extend ActionSupport, instead of Action.
 While this is not mandatory, it is beneficial to do so because then any
 POJO can be used as an Action Object. Further we then will have access to
 predefined tokens such as SUCCESS and ERROR.
 
 c) The fileds are now a property of the only ActionSupport class. So the
 values can be set directly. The way of returning “success” can be modified
 to return Action.SUCCESS and return Action.ERROR
 
 The new Action class now looks like
 
   
 import com.opensymphony.xwork2.ActionSupport;
 
 public class Hello extends ActionSupport {
 
   public String execute() throws Exception {
   setMessage(“Hello”);
   return Action.SUCCESS;
   }
 
   private String field1;
 
   public String getField1() {
   return field1;
   }
 public void setField1(String field1) {
 this.field1 = 

Re: migration from struts 1 to 2

2008-04-28 Thread Alberto A. Flores

Yes it is!

Sandy143 wrote:

Hello,

Can't we have the existing struts1 actions and struts2 actions in the same
application?

I want to retain my existing web app which is using struts 1.2.8 and tiles
1.1

The new module in the same webapp, I would like to develop using struts2 .

Please let me know if this is something that is possible or not?

Thanks,
Sandy


sukritthareja wrote:

Here are the steps for Migrating from Struts 1 to Struts 2. You are
required to make changes in the below mentioned layers”


1.  JARs

- Add Struts 2 JARs in WEB-INF/lib


2.  web.xml

- Add following elements to web.xml
?xml version=1.0 encoding=UTF-8?
web-app id=WebApp_ID version=2.4
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

filter
filter-namestruts2/filter-name
filter-class org.apache.struts2.dispatcher.FilterDispatcher
/filter-class
/filter

filter-mapping
filter-namestruts2/filter-name
url-pattern/*/url-pattern
/filter-mapping

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


/web-app

3.  struts-config.xml

- Rename “struts-config.xml” to “struts.xml”. Technically, this file in
Struts 2 is 	more streamlined.  


A typical struts-config.xml file of Struts 1 looks like
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 1.3//EN
http://struts.apache.org/dtds/struts-config_1_3.dtd 

struts-config

form-beans

  form-bean name=MyClassForm type=forms.MyClassForm
  /form-bean
/form-beans

  action-mappings
action path=/MyClass name=MyClassFormtype=actions.MyClassAction 
validate=false

   forward name=success path=/Index.jsp/
  /action
  /action-mappings

  message-resources parameter=resources/

/struts-config

-   Perform the following actions:



a)  Replace DTD
b)  Replace struts-config tag with struts
c)  Include include file=struts-default.xml/
d)  Remove the form-beans element
e)  Change action-mappings to package name=hello-default
extends=struts-default
f)  Update each action element by
-   Removing from action element, the “name” attribute.
-   Changing the action “path” attribute to “name”
-   Changing the action “type” attribute to “class”
-   Changing the forward element into a return element

   The new struts.xml now looks like

?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd 

struts

include file=struts-default.xml/

package name=hello-default extends=struts-default

action name=MyClass class=actions.MyClass
result/Index.jsp/result
/action

/package


/struts

4.  Action Classes

A typical ActionForm class in Struts 1 looks like

import org.apache.struts.action.ActionForm;

public class MyClassForm extends ValidatorForm {

private String field1;

public String getField1() {
return field1;
}

public void setField1(String field1) {
this.field1 = field1;
}

}

A typical Action class in Struts 1 looks like

import javax.servlet.http.*;
import org.apache.struts.action.*;
public class MyClassAction extends Action {

public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

MyClassForm input = (MyClassForm) form;
input.setField1(“Hello”);
return mapping.findForward(“success”);
}

}

a) Copy all the properties from the ActionForm class to the Action class,
and remove the ActionForm class object completely. There is no ActionForm
in Struts-2.

b) Make your Action class to extend ActionSupport, instead of Action.
While this is not mandatory, it is beneficial to do so because then any
POJO can be used as an Action Object. Further we then will have access to
predefined tokens such as SUCCESS and ERROR.

c) The fileds are now a property of the only ActionSupport class. So the
values can be set directly. The way of returning “success” can be modified
to return Action.SUCCESS and return Action.ERROR

The new Action class now looks like

  
import com.opensymphony.xwork2.ActionSupport;


public class Hello extends ActionSupport {

public String execute() throws Exception {
setMessage(“Hello”);
return Action.SUCCESS;
}

private String field1;

public String getField1() {
return field1;
}
public void setField1(String field1) {
this.field1 = field1;
}


d). There is a special feature 

Re: Struts1 and Struts2 in the same app

2008-04-28 Thread Dave Newton
You're including the S1 configuration file in the S2 config file?

Dave

--- Sandy143 [EMAIL PROTECTED] wrote:

 
 In struts.xml, I have
 
 -
 include file=/WEB-INF/struts-config.xml /
 include file=/struts-config-two.xml / 
 -
 yes! struts.xml is placed in WEB-INF/classes/  
 
 Do you have any solution for it?
 
 
 
 KonTiki wrote:
  
  Hi Sandy,
  
  How exactly did you do the struts.xml inclusion?
  (I had a similar problem, where I found the struts.xml for struts 2
 wasn't
  picking the correct xml)
  And by java source folder - do you mean WEB-INF/classes/  ?
  
  
  Sandy143 wrote:
  
  I  have to integrate struts 2 actions in my existing struts 1.2 web
  application.
  
  My login page is using struts 1.2 action. Upon login, I come to home
  page. there is a link on home page. when I click on that link, I need to
  go to another jsp page. The later action has to be in struts 2. 
  
  I have added filter, filter mapping for struts 2 in web.xml.
  
  I have included struts.xml in the root of the project (under java source
  folder). This included struts-config.xml (using struts 1.2.8) and
  struts-config-two.xml (using struts 2). 
  
   -- struts-config.xml is in web-inf
  
  -- struts-config-two.xml is in the root of the project (under java
  source folder)
  
   my  struts-config-two.xml is :
  
  -
  ?xml version=1.0 encoding=UTF-8 ?
  
  !DOCTYPE struts PUBLIC
  
  -//Apache Software Foundation//DTD Struts Configuration
 2.0//EN
  
  http://struts.apache.org/dtds/struts-2.0.dtd;
  
   struts
  package name=xxx namespace=/xxx extends=xxx-default
  
  action name=testAction2 
 
  class=x.y.z.presentation.test.TestAction2
   result name=home /TestLink.jsp
 /result
  /action
  
  /package
  /struts
  
  
 
 --
  
  In my TestLink.jsp, I am specifying :
  
  s:url id=viewURL namespace=/xxx action=testAction2 / 
  
  s:a href=%{viewURL} Test Link Home /s:a Test Link
  
  
 

-
  
  I am able to login to the app. but When I click on the link I get an
  error message : ERROR action.RequestProcessor  - Invalid path was
  requested /xxx/TestAction.
  
  Can you please help me to resolve this issue.
  
   I would have to use struts2 action in the flow of struts1 action.
 Please
  let me know the step by step procedure. Can anyone provide a sample app
  or config info on how it can be done?
  
  I have read the migration tutorial. but it didn't help me to resolve
 this
  issue.
  
   
  
   
  
   
  
  
  
  
 
 -- 
 View this message in context:

http://www.nabble.com/Struts1-and-Struts2-in-the-same-app-tp16851031p16942822.html
 Sent from the Struts - User mailing list archive at Nabble.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: migration from struts 1 to 2

2008-04-28 Thread Sandy143

Thank you very much for the very prompt reply.

If it possible, then How would I differentiate between struts1 action
classes and struts2 action classes (apart from ActionSupport)?

Right now, I am trying to use struts2 action in the flow of struts1 action
classes.

How do I map action classes?

I have struts-config.xml and struts.xml. 

What would be the controller in this case? 

Please let me know ...

Thanks,
Sanday


Alberto A. Flores wrote:
 
 Yes it is!
 
 Sandy143 wrote:
 Hello,
 
 Can't we have the existing struts1 actions and struts2 actions in the
 same
 application?
 
 I want to retain my existing web app which is using struts 1.2.8 and
 tiles
 1.1
 
 The new module in the same webapp, I would like to develop using struts2
 .
 
 Please let me know if this is something that is possible or not?
 
 Thanks,
 Sandy
 
 
 sukritthareja wrote:
 Here are the steps for Migrating from Struts 1 to Struts 2. You are
 required to make changes in the below mentioned layers”


 1.  JARs

 - Add Struts 2 JARs in WEB-INF/lib


 2.  web.xml

 - Add following elements to web.xml
 ?xml version=1.0 encoding=UTF-8?
 web-app id=WebApp_ID version=2.4
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

 filter
 filter-namestruts2/filter-name
 filter-class org.apache.struts2.dispatcher.FilterDispatcher
 /filter-class
 /filter

 filter-mapping
 filter-namestruts2/filter-name
 url-pattern/*/url-pattern
 /filter-mapping

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

 
 /web-app

 3.  struts-config.xml

 - Rename “struts-config.xml” to “struts.xml”. Technically, this file in
 Struts 2 is more streamlined.  

 A typical struts-config.xml file of Struts 1 looks like
 ?xml version=1.0 encoding=ISO-8859-1 ?
 !DOCTYPE struts-config PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 1.3//EN
 http://struts.apache.org/dtds/struts-config_1_3.dtd 

 struts-config
 
 form-beans
   form-bean name=MyClassForm type=forms.MyClassForm
   /form-bean
 /form-beans

   action-mappings
 action path=/MyClass name=MyClassForm   
 type=actions.MyClassAction 
 validate=false
forward name=success path=/Index.jsp/
   /action
   /action-mappings

   message-resources parameter=resources/

 /struts-config

 -   Perform the following actions:



 a)  Replace DTD
 b)  Replace struts-config tag with struts
 c)  Include include file=struts-default.xml/
 d)  Remove the form-beans element
 e)  Change action-mappings to package name=hello-default
 extends=struts-default
 f)  Update each action element by
 -   Removing from action element, the “name” attribute.
 -   Changing the action “path” attribute to “name”
 -   Changing the action “type” attribute to “class”
 -   Changing the forward element into a return element

The new struts.xml now looks like

 ?xml version=1.0 encoding=UTF-8 ?
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
 http://struts.apache.org/dtds/struts-2.0.dtd 

 struts

 include file=struts-default.xml/

 package name=hello-default extends=struts-default

 action name=MyClass class=actions.MyClass
 result/Index.jsp/result
 /action
 
 /package

 /struts

 4.  Action Classes

 A typical ActionForm class in Struts 1 looks like

 import org.apache.struts.action.ActionForm;

 public class MyClassForm extends ValidatorForm {

 private String field1;

 public String getField1() {
 return field1;
 }

 public void setField1(String field1) {
 this.field1 = field1;
 }

 }

 A typical Action class in Struts 1 looks like

 import javax.servlet.http.*;
 import org.apache.struts.action.*;
 public class MyClassAction extends Action {

 public ActionForward execute(
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response)
 throws Exception {

 MyClassForm input = (MyClassForm) form;
 input.setField1(“Hello”);
 return mapping.findForward(“success”);
 }
 
 }

 a) Copy all the properties from the ActionForm class to the Action
 class,
 and remove the ActionForm class object completely. There is no
 ActionForm
 in Struts-2.

 b) Make your Action class to extend ActionSupport, instead of Action.
 While this is not mandatory, it is beneficial to do so because then any
 POJO can be used as an Action Object. Further we then will have access
 to
 predefined tokens such as SUCCESS and ERROR.

 c) The fileds are now a property of the only ActionSupport class. So the
 values can be set directly. The way of returning “success” can be
 modified
 to return Action.SUCCESS and return Action.ERROR

 The new Action class now looks like

  

Re: Struts1 and Struts2 in the same app

2008-04-28 Thread Sandy143

yes!

Am I wrong? Please let me know ...how to use both the config files.

I tried that way ...I should be wrong as I remained unsuccessful in using
that way.

I get an error :

 ERROR action.RequestProcessor  - Invalid path was requested 



newton.dave wrote:
 
 You're including the S1 configuration file in the S2 config file?
 
 Dave
 
 --- Sandy143 [EMAIL PROTECTED] wrote:
 
 
 In struts.xml, I have
 
 -
 include file=/WEB-INF/struts-config.xml /
 include file=/struts-config-two.xml / 
 -
 yes! struts.xml is placed in WEB-INF/classes/  
 
 Do you have any solution for it?
 
 
 
 KonTiki wrote:
  
  Hi Sandy,
  
  How exactly did you do the struts.xml inclusion?
  (I had a similar problem, where I found the struts.xml for struts 2
 wasn't
  picking the correct xml)
  And by java source folder - do you mean WEB-INF/classes/  ?
  
  
  Sandy143 wrote:
  
  I  have to integrate struts 2 actions in my existing struts 1.2 web
  application.
  
  My login page is using struts 1.2 action. Upon login, I come to home
  page. there is a link on home page. when I click on that link, I need
 to
  go to another jsp page. The later action has to be in struts 2. 
  
  I have added filter, filter mapping for struts 2 in web.xml.
  
  I have included struts.xml in the root of the project (under java
 source
  folder). This included struts-config.xml (using struts 1.2.8) and
  struts-config-two.xml (using struts 2). 
  
   -- struts-config.xml is in web-inf
  
  -- struts-config-two.xml is in the root of the project (under java
  source folder)
  
   my  struts-config-two.xml is :
  
  -
  ?xml version=1.0 encoding=UTF-8 ?
  
  !DOCTYPE struts PUBLIC
  
  -//Apache Software Foundation//DTD Struts Configuration
 2.0//EN
  
  http://struts.apache.org/dtds/struts-2.0.dtd;
  
   struts
  package name=xxx namespace=/xxx
 extends=xxx-default
  
  action name=testAction2 
 
  class=x.y.z.presentation.test.TestAction2
   result name=home /TestLink.jsp
 /result
  /action
  
  /package
  /struts
  
  
 
 --
  
  In my TestLink.jsp, I am specifying :
  
  s:url id=viewURL namespace=/xxx action=testAction2 / 
  
  s:a href=%{viewURL} Test Link Home /s:a Test Link
  
  
 

 -
  
  I am able to login to the app. but When I click on the link I get an
  error message : ERROR action.RequestProcessor  - Invalid path was
  requested /xxx/TestAction.
  
  Can you please help me to resolve this issue.
  
   I would have to use struts2 action in the flow of struts1 action.
 Please
  let me know the step by step procedure. Can anyone provide a sample
 app
  or config info on how it can be done?
  
  I have read the migration tutorial. but it didn't help me to resolve
 this
  issue.
  
   
  
   
  
   
  
  
  
  
 
 -- 
 View this message in context:

 http://www.nabble.com/Struts1-and-Struts2-in-the-same-app-tp16851031p16942822.html
 Sent from the Struts - User mailing list archive at Nabble.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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts1-and-Struts2-in-the-same-app-tp16851031p16945340.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts1 and Struts2 in the same app

2008-04-28 Thread Sandy143

Even if I don't include ... it is the same.

It doesnot invoke struts2 action class.


newton.dave wrote:
 
 You're including the S1 configuration file in the S2 config file?
 
 Dave
 
 --- Sandy143 [EMAIL PROTECTED] wrote:
 
 
 In struts.xml, I have
 
 -
 include file=/WEB-INF/struts-config.xml /
 include file=/struts-config-two.xml / 
 -
 yes! struts.xml is placed in WEB-INF/classes/  
 
 Do you have any solution for it?
 
 
 
 KonTiki wrote:
  
  Hi Sandy,
  
  How exactly did you do the struts.xml inclusion?
  (I had a similar problem, where I found the struts.xml for struts 2
 wasn't
  picking the correct xml)
  And by java source folder - do you mean WEB-INF/classes/  ?
  
  
  Sandy143 wrote:
  
  I  have to integrate struts 2 actions in my existing struts 1.2 web
  application.
  
  My login page is using struts 1.2 action. Upon login, I come to home
  page. there is a link on home page. when I click on that link, I need
 to
  go to another jsp page. The later action has to be in struts 2. 
  
  I have added filter, filter mapping for struts 2 in web.xml.
  
  I have included struts.xml in the root of the project (under java
 source
  folder). This included struts-config.xml (using struts 1.2.8) and
  struts-config-two.xml (using struts 2). 
  
   -- struts-config.xml is in web-inf
  
  -- struts-config-two.xml is in the root of the project (under java
  source folder)
  
   my  struts-config-two.xml is :
  
  -
  ?xml version=1.0 encoding=UTF-8 ?
  
  !DOCTYPE struts PUBLIC
  
  -//Apache Software Foundation//DTD Struts Configuration
 2.0//EN
  
  http://struts.apache.org/dtds/struts-2.0.dtd;
  
   struts
  package name=xxx namespace=/xxx
 extends=xxx-default
  
  action name=testAction2 
 
  class=x.y.z.presentation.test.TestAction2
   result name=home /TestLink.jsp
 /result
  /action
  
  /package
  /struts
  
  
 
 --
  
  In my TestLink.jsp, I am specifying :
  
  s:url id=viewURL namespace=/xxx action=testAction2 / 
  
  s:a href=%{viewURL} Test Link Home /s:a Test Link
  
  
 

 -
  
  I am able to login to the app. but When I click on the link I get an
  error message : ERROR action.RequestProcessor  - Invalid path was
  requested /xxx/TestAction.
  
  Can you please help me to resolve this issue.
  
   I would have to use struts2 action in the flow of struts1 action.
 Please
  let me know the step by step procedure. Can anyone provide a sample
 app
  or config info on how it can be done?
  
  I have read the migration tutorial. but it didn't help me to resolve
 this
  issue.
  
   
  
   
  
   
  
  
  
  
 
 -- 
 View this message in context:

 http://www.nabble.com/Struts1-and-Struts2-in-the-same-app-tp16851031p16942822.html
 Sent from the Struts - User mailing list archive at Nabble.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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts1-and-Struts2-in-the-same-app-tp16851031p16945436.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts1 and Struts2 in the same app

2008-04-28 Thread Dave Newton
--- Sandy143 [EMAIL PROTECTED] wrote:
 Am I wrong? Please let me know ...how to use both the config files.

An included file within struts.xml is expected to be an S2 config, AFAIK.

Were there any error messages in the logs?

If you're using the S1 plugin then the docs at [1] give a decent overview.
There is a known issue with using the S1 plugin with S1.3.8, but you
indicated you were using S1.2; I think you're having some more basic
configuration issues.

If you're not using the S1 plugin I'd assume the two frameworks are running
in parallel: each would require its own configuration, any request mapping
issues are resolved, etc.

Dave

[1] http://struts.apache.org/2.x/docs/struts-1-plugin.html

 newton.dave wrote:
  You're including the S1 configuration file in the S2 config file?
  
  --- Sandy143 [EMAIL PROTECTED] wrote:
  In struts.xml, I have
  
  -
  include file=/WEB-INF/struts-config.xml /
  include file=/struts-config-two.xml / 
  -
  yes! struts.xml is placed in WEB-INF/classes/  
  
  Do you have any solution for it?
  
  KonTiki wrote:
   How exactly did you do the struts.xml inclusion?
   (I had a similar problem, where I found the struts.xml for struts 2
  wasn't
   picking the correct xml)
   And by java source folder - do you mean WEB-INF/classes/  ?
   
   
   Sandy143 wrote:
   
   I  have to integrate struts 2 actions in my existing struts 1.2 web
   application.
   
   My login page is using struts 1.2 action. Upon login, I come to home
   page. there is a link on home page. when I click on that link, I need
  to
   go to another jsp page. The later action has to be in struts 2. 
   
   I have added filter, filter mapping for struts 2 in web.xml.
   
   I have included struts.xml in the root of the project (under java
  source
   folder). This included struts-config.xml (using struts 1.2.8) and
   struts-config-two.xml (using struts 2). 
   
-- struts-config.xml is in web-inf
   
   -- struts-config-two.xml is in the root of the project (under java
   source folder)
   
my  struts-config-two.xml is :
   
   -
   ?xml version=1.0 encoding=UTF-8 ?
   
   !DOCTYPE struts PUBLIC
   
   -//Apache Software Foundation//DTD Struts Configuration
  2.0//EN
   
   http://struts.apache.org/dtds/struts-2.0.dtd;
   
struts
   package name=xxx namespace=/xxx
  extends=xxx-default
   
   action name=testAction2 
  
   class=x.y.z.presentation.test.TestAction2
result name=home /TestLink.jsp
  /result
   /action
   
   /package
   /struts
   
   
  
 
 --
   
   In my TestLink.jsp, I am specifying :
   
   s:url id=viewURL namespace=/xxx action=testAction2 / 
   
   s:a href=%{viewURL} Test Link Home /s:a Test Link
   
   
  
 
 

-
   
   I am able to login to the app. but When I click on the link I get an
   error message : ERROR action.RequestProcessor  - Invalid path was
   requested /xxx/TestAction.
   
   Can you please help me to resolve this issue.
   
I would have to use struts2 action in the flow of struts1 action.
  Please
   let me know the step by step procedure. Can anyone provide a sample
  app
   or config info on how it can be done?
   
   I have read the migration tutorial. but it didn't help me to resolve
  this
   issue.


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



Re: [ANN] Practical Apache Struts2 Web 2.0 Projects

2008-04-28 Thread raxden2

HI! i had the same problem, but I have another problem:

When i push the button for save Event... throws this exception:

excepción 

javax.servlet.ServletException: javax.persistence.PersistenceException:
org.hibernate.PersistentObjectException: detached entity passed to persist:
com.fdar.apress.s2.domain.Location

org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)

org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)

com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)

com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)

org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)

causa raíz 

javax.persistence.PersistenceException:
org.hibernate.PersistentObjectException: detached entity passed to persist:
com.fdar.apress.s2.domain.Location

org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)

org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)

com.fdar.apress.s2.services.EventServiceImpl.create(EventServiceImpl.java:24)

com.fdar.apress.s2.actions.event.SaveEventAction.execute(SaveEventAction.java:32)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

..

causa raíz 

org.hibernate.PersistentObjectException: detached entity passed to persist:
com.fdar.apress.s2.domain.Location

org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:79)
org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:609)
org.hibernate.impl.SessionImpl.persist(SessionImpl.java:601)
org.hibernate.engine.CascadingAction$8.cascade(CascadingAction.java:295)
org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)

..

I need help, i don´t know how resolve this.


Thanks.





Ian Roughley wrote:
 
 I'm not sure, and I'm only taking an educated guess at it being 
 OS/platform-dependent (since a JAR that worked for me had problems for 
 another user).  Unfortunately I can't reproduce the error.  I'm all for 
 doing the work to fix the problem if someone has the problem and cycles 
 to work through testing it.
 
 /Ian
 
 Dave Newton wrote:
 --- Ian Roughley [EMAIL PROTECTED] wrote:
   
 The solution provided to me was to change the scope interceptor 
 reference to use a session value of Model rather than model - see
 below.

   interceptor-ref name=scope
 Model
 partialEvent
   /interceptor-ref
 

 Hmm, why does that fix it? If it's an OS-dependent issue we should fix it
 for
 real.

 Dave


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

   
 
 

-- 
View this message in context: 
http://www.nabble.com/-ANN--Practical-Apache-Struts2-Web-2.0-Projects-tp13863084p16945872.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Url tag and automatic parameter setting

2008-04-28 Thread Laurie Harper

Jukka Välimaa wrote:

Hi,

I have a problem--more of an annoyance, really--with struts s:url tag. It
adds parameters into the result url without my say-so and I don't really
understand on what grounds. For example, I had the following in my jsp page:
s:url id=addNewContract action=ajaxEditContract
s:param name=decorate value=false /
/s:url

It evaluated to this:
ajaxEditContract.html?id=-3amp;amp;decorate=falseamp;amp;dojo.preventCache=1209372598206amp;amp;committerId=-7
amp;dojo.preventCache=1209372600172amp;decorate=false

I can understand it adds the ajax stuff automatically (although I don't know
why and when). What I don't understand is, why does it add committerId and
id as parameters. Both are available via getters in my action, and
committerId is used in the form that comes after I define the url. Id,
however, is not used at all in the page. To avoid problems, I have to create
the url like this:

s:url id=addNewContract action=ajaxEditContract
s:param name=decorate value=false /
s:param name=id value=null /
/s:url


To avoid problems in the future, I'd like to understand why exactly does the
url tag behave like this. I understand includeParams attribute is used to
set how the tag behaves with parameters, but there is no explanation in the
tag reference what all and get are supposed to do.

Can anyone tell me why does the url tag behave the way it does, or where I
could find an explanation?


The parameters in the generated URL come from the current request -- 
i.e. the request that results in the tag being called. With 
includeParams set to 'get', the URL includes the current request's GET 
parameters -- i.e. those from the query string -- but not any POST 
parameters that may be present. With 'all' the URL will include both GET 
and POST parameters.


As you're probably aware, the default is 'get' and can be overridden in 
your struts.xml / struts.properties.


L.


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



Re: [ANN] Practical Apache Struts2 Web 2.0 Projects

2008-04-28 Thread Jim Kiley
Are you using the OpenSessionInViewFilter?  If you aren't, you'll want to.

If you are doing that already, you may be trying to persist when you should
merge.  If you're using Hibernate's API directly, take advantage of
Hibernate's saveOrUpdate() method, rather than the JPA merge()/persiste()
methods.

Jim Kiley
Technical Consultant
Summa
[EMAIL PROTECTED]


On Mon, Apr 28, 2008 at 3:50 PM, raxden2 [EMAIL PROTECTED] wrote:


 HI! i had the same problem, but I have another problem:

 When i push the button for save Event... throws this exception:

 excepción

 javax.servlet.ServletException: javax.persistence.PersistenceException:
 org.hibernate.PersistentObjectException: detached entity passed to
 persist:
 com.fdar.apress.s2.domain.Location

  org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)


 org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)


 com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)


 com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)


 org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)

 causa raíz

 javax.persistence.PersistenceException:
 org.hibernate.PersistentObjectException: detached entity passed to
 persist:
 com.fdar.apress.s2.domain.Location


 org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629)


 org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:218)


 com.fdar.apress.s2.services.EventServiceImpl.create(EventServiceImpl.java:24)


 com.fdar.apress.s2.actions.event.SaveEventAction.execute(SaveEventAction.java:32)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

 ..

 causa raíz

 org.hibernate.PersistentObjectException: detached entity passed to
 persist:
 com.fdar.apress.s2.domain.Location


 org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:79)
org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:609)
org.hibernate.impl.SessionImpl.persist(SessionImpl.java:601)

  org.hibernate.engine.CascadingAction$8.cascade(CascadingAction.java:295)
org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)

 ..

 I need help, i don´t know how resolve this.


 Thanks.





 Ian Roughley wrote:
 
  I'm not sure, and I'm only taking an educated guess at it being
  OS/platform-dependent (since a JAR that worked for me had problems for
  another user).  Unfortunately I can't reproduce the error.  I'm all for
  doing the work to fix the problem if someone has the problem and cycles
  to work through testing it.
 
  /Ian
 
  Dave Newton wrote:
  --- Ian Roughley [EMAIL PROTECTED] wrote:
 
  The solution provided to me was to change the scope interceptor
  reference to use a session value of Model rather than model - see
  below.
 
interceptor-ref name=scope
  Model
  partialEvent
/interceptor-ref
 
 
  Hmm, why does that fix it? If it's an OS-dependent issue we should fix
 it
  for
  real.
 
  Dave
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/-ANN--Practical-Apache-Struts2-Web-2.0-Projects-tp13863084p16945872.html
 Sent from the Struts - User mailing list archive at Nabble.com.


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




-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com


Re: Struts2 Unit Testing

2008-04-28 Thread Adam Hardy

Nils-Helge Garli Hegvik on 28/04/08 17:51, wrote:

- Don't get caught up in the code coverage hysteria. Focus on writing
good tests instead of how many lines and branches of code you have
tested.


 I've no idea what level of code coverage Nils holds to be hysterical, but I
wouldn't take his advice to mean you should avoid code coverage analysis.



What I meant is that it can easily be misused. Code coverage is a nice
tool for guidance, to identify areas that needs improvement - I use
them myself too. But it's easy to get caught up in the idea of
increasing the coverage percentage just to increase the percentage of
coverage, if you understand what I mean. I don't think looking at a
coverage report and write a test just to cover that one line of code
will necessarily lead to a better tested code base. As long as you
focus on writing good tests, coverage will naturally become better.


You're totally right, that's a good skill to have, along with writing code that 
can be tested easily.


Back to code coverage statistics, high coverage is something I always like to 
see in other people's code, but not necessarily something I feel is right for my 
own!!! Seriously though, good coverage statistics on an open source project is a 
great advert.


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



devMode + Windows + Eclipse + Tomcat = not reloading struts.xml

2008-04-28 Thread Chase

Anyone had issues with devMode not working fully on Windows?

I've got constant name=struts.devMode value=true / set and in my 
Tomcat console log I'm seeing:
INFO: Overriding property struts.configuration.xml.reload - old value: 
false new value: true


Windows XP
Sun JDK 1.6u6
Eclipse 3.3.2
Tomcat 6.0.16

Tomcat is being controlled and deployed to by Eclipse.

Thanks,
-Chase

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



Struts 1 hidden tag

2008-04-28 Thread bhaarat Sharma
Hello

I am using struts 1

have a Question with the hidden tag.

I have a bean named addPartnerGrantModificationForm which has a
property called dateStart

I want to pass a hidden property named dateStartHidden and give it the
value coming from dateStart method of the
addPartnerGrantModificationForm  bean.

How can i do this??

this works
html:hidden property=dateStart/ BUT when rendered it is convertint
o the following html
input type=hidden name=dateStart value=10/19/2007/

I want it to be like this
input type=hidden name=dateStartHidden value=10/19/2007/

I've tried various things but none seem to be working :(

please help!

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



Re: devMode + Windows + Eclipse + Tomcat = not reloading struts.xml

2008-04-28 Thread Adam Hardy

Chase on 28/04/08 22:14, wrote:

Anyone had issues with devMode not working fully on Windows?

I've got constant name=struts.devMode value=true / set and in my 
Tomcat console log I'm seeing:
INFO: Overriding property struts.configuration.xml.reload - old value: 
false new value: true


Windows XP
Sun JDK 1.6u6
Eclipse 3.3.2
Tomcat 6.0.16

Tomcat is being controlled and deployed to by Eclipse.


Not fully working? Is it showing any devMode signs? ResourceBundle? struts.xml? 
Extra logging?


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



struts2 displayTag how to use checkBox; Problem: translating the fieldValue

2008-04-28 Thread xianwinwin

Hi all,

I have a table with a list of buyers. Each buyer has a checkBox that the
user can click and decide if he wants to work with them.

I'm using displayTag and this is my code:

display:columns:checkbox theme=simple name=userCheck
fieldValue='${entityId}'//display:column

I wonder why I don't get the *value/content* of the userCheck. Instead, I
get ${entityId} (this really very string)

any idea how to get the entityId (the number)?

thank you! 
-- 
View this message in context: 
http://www.nabble.com/struts2---displayTag-how-to-use-checkBox--Problem%3A-translating-the-fieldValue-tp16945993p16945993.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Simplified usage of:@com.company.Constants.StaticCOnstants

2008-04-28 Thread Wes Wannemacher

http://struts.apache.org/2.x/docs/set.html



On Mon, 2008-04-28 at 08:17 -0700, ravi_eze wrote:
 hi,
 
 we want to access the constants in our jsp page. So we are proceeding as
 follows:
 
  s:text field name=[EMAIL PROTECTED]@STATIC_CONSTANTS1] /
 
 the problem with this is that we need to repeat the @com.company.Constants
 always. So is there a simple way to get this working? I wanted to try out
 S:bean and s:Push... but no luck... 
 
 please help.
 
 cheers,
 ravi 
 
 


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



Removing package name all over does not work

2008-04-28 Thread Vinay Nagrik
Hello Group,

I am working with the preliminary HelloWorld.java example and removed the
very first line in HelloWorld.java

i.e I commented out

package tutorial;

Thereafter I modified the struts.xml file and it looks like


!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd;struts
package name= extends=struts-default
action name=HelloWorld class=HelloWorld
result/HelloWorld.jsp/result
/action
!-- Add your actions here --
/package/struts

What does the name in

package name= extends=struts-default

mean?

I compiled my HelloWorld.java and put the HelloWorld.class in the
WEB-INF/classes directory.

Then I tried deploying it through

localhost:8080/HelloWorld.action

It gives errors as

The requested resoruce (/HelloWorld.action) is not available.

However, if I put the package name back in all those places and run it like

localhost:8080/tutorial/HelloWorld.action



Then it works perfectly.



For compiling I am always using



javac -d classpath javafile

Can someone please tell me what happens why does it not work if I take away
the package name from all the places.
-- 
Thanks

Nagrik


Re: devMode + Windows + Eclipse + Tomcat = not reloading struts.xml

2008-04-28 Thread Chase

Adam Hardy wrote:

Chase on 28/04/08 22:14, wrote:

Anyone had issues with devMode not working fully on Windows?

I've got constant name=struts.devMode value=true / set and in 
my Tomcat console log I'm seeing:
INFO: Overriding property struts.configuration.xml.reload - old 
value: false new value: true


Windows XP
Sun JDK 1.6u6
Eclipse 3.3.2
Tomcat 6.0.16

Tomcat is being controlled and deployed to by Eclipse.


Not fully working? Is it showing any devMode signs? ResourceBundle? 
struts.xml? Extra logging?


Yes, for instance I'm getting the Struts Problem Report page instead of 
the basic 404 pages. I haven't check ResourceBundles yet. Same project 
and versions of Struts/Tomcat/Eclipse on a Linux box work with no 
problem. I'm just not seeing struts.xml reloading on Windows systems.


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



War file does not deploy

2008-04-28 Thread Vinay Nagrik
Hello Group,

In my server.xml the appbase is webapps and I have copied a mailreader.war
file in webapps directory

However the following url does not work in tomcat

localhost:8080/mailreader.war

It says

The requested resource (/mailreader.war) is not available.

-- 
Thanks

Nagrik


Re: Removing package name all over does not work

2008-04-28 Thread Dave Newton
Is the Java class being deployed to the proper location? If you just deleted
the package statement w/o moving the file to the appropriate directory you
might run into problems.

Do you have debugging turned up and/or struts.devMode turned on?

Dave

--- Vinay Nagrik [EMAIL PROTECTED] wrote:
 I am working with the preliminary HelloWorld.java example and removed the
 very first line in HelloWorld.java
 
 i.e I commented out
 
 package tutorial;
 
 Thereafter I modified the struts.xml file and it looks like
 
 
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
 http://struts.apache.org/dtds/struts-2.0.dtd;struts
 package name= extends=struts-default
 action name=HelloWorld class=HelloWorld
 result/HelloWorld.jsp/result
 /action
 !-- Add your actions here --
 /package/struts
 
 What does the name in
 
 package name= extends=struts-default
 
 mean?
 
 I compiled my HelloWorld.java and put the HelloWorld.class in the
 WEB-INF/classes directory.
 
 Then I tried deploying it through
 
 localhost:8080/HelloWorld.action
 
 It gives errors as
 
 The requested resoruce (/HelloWorld.action) is not available.
 
 However, if I put the package name back in all those places and run it like
 
 localhost:8080/tutorial/HelloWorld.action
 
 
 
 Then it works perfectly.
 
 
 
 For compiling I am always using
 
 
 
 javac -d classpath javafile
 
 Can someone please tell me what happens why does it not work if I take away
 the package name from all the places.


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



Re: War file does not deploy

2008-04-28 Thread Dave Newton
--- Vinay Nagrik [EMAIL PROTECTED] wrote:
 In my server.xml the appbase is webapps and I have copied a
 mailreader.war file in webapps directory
 
 However the following url does not work in tomcat
 
 localhost:8080/mailreader.war
 
 It says
 
 The requested resource (/mailreader.war) is not available.

How familiar are you with Java web application programming?

Dave


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



Re: Removing package name all over does not work

2008-04-28 Thread Wes Wannemacher
Vinay, 

You are talking about two different things... First off, in the java
source file, the statement 'package tutorial;' relates to the following 

http://java.sun.com/docs/books/tutorial/java/package/packages.html

In struts2, the package declaration is a way to logically organize your
actions. It is documented here -

http://struts.apache.org/2.x/docs/package-configuration.html

-Wes
 
On Mon, 2008-04-28 at 17:32 -0700, Vinay Nagrik wrote:
 Hello Group,
 
 I am working with the preliminary HelloWorld.java example and removed the
 very first line in HelloWorld.java
 
 i.e I commented out
 
 package tutorial;
 
 Thereafter I modified the struts.xml file and it looks like
 
 
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
 http://struts.apache.org/dtds/struts-2.0.dtd;struts
 package name= extends=struts-default
 action name=HelloWorld class=HelloWorld
 result/HelloWorld.jsp/result
 /action
 !-- Add your actions here --
 /package/struts
 
 What does the name in
 
 package name= extends=struts-default
 
 mean?
 
 I compiled my HelloWorld.java and put the HelloWorld.class in the
 WEB-INF/classes directory.
 
 Then I tried deploying it through
 
 localhost:8080/HelloWorld.action
 
 It gives errors as
 
 The requested resoruce (/HelloWorld.action) is not available.
 
 However, if I put the package name back in all those places and run it like
 
 localhost:8080/tutorial/HelloWorld.action
 
 
 
 Then it works perfectly.
 
 
 
 For compiling I am always using
 
 
 
 javac -d classpath javafile
 
 Can someone please tell me what happens why does it not work if I take away
 the package name from all the places.


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



Re: War file does not deploy

2008-04-28 Thread Wes Wannemacher
Vinay,

did you try -

http://localhost:8080/mailreader/

?


On Mon, 2008-04-28 at 17:46 -0700, Vinay Nagrik wrote:
 Hello Group,
 
 In my server.xml the appbase is webapps and I have copied a mailreader.war
 file in webapps directory
 
 However the following url does not work in tomcat
 
 localhost:8080/mailreader.war
 
 It says
 
 The requested resource (/mailreader.war) is not available.
 


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



jsp page with s:action to call an action with a redirect-action

2008-04-28 Thread crappycrumpet

Hi,

I have a problem where I have a page (let's call it a.jsp) which calls an
action using s:action (let's call it actionB in namepaceB) which redirects
to actionA in namespaceA, using redirect-action, which display the name
attribute in object a. (both implements modelDriven).

actionB take parameter b.id to find the object b.
actionA take parameter a.blahId to find object a.

so in my struts.xml I have the following setup.
package name=namespaceA namespace=/namespaceA
  action name=actionA method=doGetA class=com.thingybob.AStuff
 resultshow_name.jsp/result
  /action
/package
package name=namespaceB namespace=/namespaceB
  action name=actionB method=doGetB class=com.thingybob.BStuff
 result type=redirect-action
actionA
namespaceA
b.thingyId
 /result
  /action
/package

Now it works fine when I call it by going to the url
http://XXX/namespaceB/actionB.action?b.id=123 but when I call it from a jsp
using s:action like below, it would do the method for actionB but not
continue to do actionA.

%@ taglib prefix=s uri=/struts-tags %
s:action name=actionB namespace=/namespaceB executeResult=true
s:param name=b.id123/s:param
/s:action

Any clue on why it doesn't work and how I can get it to work?

Thanks!
CC
-- 
View this message in context: 
http://www.nabble.com/jsp-page-with-s%3Aaction-to-call-an-action-with-a-redirect-action-tp16951812p16951812.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: Struts 2 s:select tag : Unable to retrieve the value in theaction

2008-04-28 Thread Binu John
This does not help. :(
I tried using the setter method as below

void setSelectKeyword(String[] selectKeyword) {
log.debug(LoginAction.class.getName() + : execute() : Checkpoint 1);
this.temp = selectKeyword;
}

But the log statement even does not gets printed. That means that the setter is 
not even getting called.
Also in the code fragment that you suggested, you specified that 
selectedKeyword is what is selected. How do we configure that?
Do we have to set some parameter to make sure that the values in the list are 
getting written back using the setter?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 29, 2008 6:47 AM
To: Binu John
Subject: Struts 2 s:select tag : Unable to retrieve the value in theaction

1. Make sure all the options you want are selected. (e.g. if your selectKeyword 
list contains all the entry that you want to be selected then make sure they 
are all highlighted when you submit the form maybe via a javascript).
2. Try getting it back as an Array of something instead.

i.e. (assuming 1. doesn't apply. I have selectKeyword as the source to select 
from and selectedKeyword which is what is selected)
private String[] selectedKeyword;
public void setSelectedKeyword(String[] selectedKeyword) {
 log.debug(LoginAction.class.getName() + : execute() : HERE
 AFASDFSD);
 this.selectedKeyword = selectedKeyword;
 }

public String saveKeyword()
{
 System.out.println(selectedKeywords: +
 selectedKeyword);
 }

Hope that helps.

Binu John wrote:


 Hi,
 I am trying to use the select tag and somehow it does not work as
 expected.
 I am populating a Map with the desired values and using that Map object in
 the select tag.

 - Start JSP -
 s:select value=selectKeyword theme=simple key=selectKeyword
 id=selectKeyword name=selectKeyword list=selectKeyword
 multiple=true/s:select
 - End JSP -

 - Start Action Code -
 private Map selectKeyword = new HashMap();
 public void setSelectKeyword(Map selectKeyword) {
 log.debug(LoginAction.class.getName() + : execute() : HERE
 AFASDFSD);
 this.selectKeyword = selectKeyword;
 }
 public Map getSelectKeyword() {
 return selectKeyword;
 }

 public String execute()
 {
 selectKeyword = populateHashMap();
 return SUCCESS;
 }
 /* This gets called when I submit the form */
 public String saveKeyword()
 {
 System.out.println(This prints size as 0 :  +
 selectKeyword.size());
 }
 - End Action Code -

 I am able to view the populated list box but when I try to retrieve the
 value back in my code, I am not getting any value.

 Any idea where I am going wrong?

 Binu John
 Programmer Analyst,
 Infosys Technologies Limited, Pune
 Mobile # +919823019001


  CAUTION - Disclaimer *
 This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
 solely for the use of the addressee(s). If you are not the intended
 recipient, please notify the sender by e-mail and delete the original
 message. Further, you are not to copy, disclose, or distribute this e-mail
 or its contents to any other person and any such actions are unlawful.
 This e-mail may contain viruses. Infosys has taken every reasonable
 precaution to minimize this risk, but is not liable for any damage you may
 sustain as a result of any virus in this e-mail. You should carry out your
 own virus checks before opening the e-mail or attachment. Infosys reserves
 the right to monitor and review the content of all messages sent to or
 from this e-mail address. Messages sent to or from this e-mail address may
 be stored on the Infosys e-mail system.
 ***INFOSYS End of Disclaimer INFOSYS***

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



Quoted from:
http://www.nabble.com/Struts-2-%3Cs%3Aselect%3E-tag-%3A-Unable-to-retrieve-the-value-in-the-action-tp16940747p16940747.html


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



Re: inheritance...

2008-04-28 Thread balaji.m.cs

ya its not a problem but i am asking can we able to reffer a childform bean
object specified in struts config with the baseform reference.. in the time
of rendering into a jsp...? 

form-bean name=baseform type=mypkg.form.BaseForm/
form-bean name=childform type=mypkg.form.ChildForm/


Antonio Petrelli-3 wrote:
 
 2008/4/27 balaji.m.cs [EMAIL PROTECTED]:
 BaseFrom extends ActionForm {

   private List myList = null;
  }

 ChildForm extends BaseForm
 
 ChildForm is also BaseForm, it's OOP inheritance, so I don't see the
 problem here.
 
 Antonio
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/inheritance...-tp16926881p16952816.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



error page and tiles.

2008-04-28 Thread balaji.m.cs

 i want to show an error page with a application error
messages 2 the users when there is an technical error...
   i am using tiles 1.2 with struts 1.3.5 when there is an error
in a jsp tile say a body part or a left part the error page is replaced @
that particular tile 
   is there any way to show the full error page rather than
replacing the particular tile part... of the layout.
-- 
View this message in context: 
http://www.nabble.com/error-page-and-tiles.-tp16952850p16952850.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



nested tags in velocity

2008-04-28 Thread Musachy Barroso
Does anyone know how to use nested tags in velocity, like building a
url? I have tried many,  many combinations of the form:

#surl ...
 #sparam ... #end
#end

and can't seem to get it right. (and google is no giving me any love
on this one)
musachy
-- 
Hey you! Would you help me to carry the stone? Pink Floyd

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



Re: jsp page with s:action to call an action with a redirect-action

2008-04-28 Thread crappycrumpet

Currently I have made a work around by assigning the result for actionB to
b.jsp which invoke actionA using another s:action and parsing the
parameter through using s:param. I just thought perhaps you can just
redirect action without a page in between the two actions. Oh well.

cheers. 
-- 
View this message in context: 
http://www.nabble.com/jsp-page-with-s%3Aaction-to-call-an-action-with-a-redirect-action-tp16951812p16952874.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: datetimepickers

2008-04-28 Thread Jeromy Evans

Alan Nisbet wrote:

Hi,

I'm trying to capture date and time from a datetimepicker, so I want 
the date object to contain both date and time. Has anyone come up with 
a decent solution on how to do this?


I would have thought it was a relatively common thing to try and do!

Best Regards,

Alan.



It's a matter of ensuring the param you post to your action is in the 
appropriate datetime format supported by the date converter (eg. RFC3339).
You can assemble the param from multiple inputs/widgets on the client 
side using javascript prior to posting a form (and after loading a page 
for the reverse)


The datetimepicker widget itself does not support selection of both date 
and time. You need multiple widgets and you'll need to format/parse the 
param in javascript yourself.


You may be less effort to use a date and time picker from a javascript 
library that supports this already.



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



Re: Simplified usage of:@com.company.Constants.StaticCOnstants

2008-04-28 Thread ravi_eze

hi,

i tried this way:
s:set name=C value=@com.company.Constants /

s:property value=[EMAIL PROTECTED] /

but its not working nor it throws an exception if its wrong way of doing. 

any help?

cheers,
ravi 



Wes Wannemacher wrote:
 
 
 http://struts.apache.org/2.x/docs/set.html
 
 
 
 On Mon, 2008-04-28 at 08:17 -0700, ravi_eze wrote:
 hi,
 
 we want to access the constants in our jsp page. So we are proceeding as
 follows:
 
  s:text field name=[EMAIL PROTECTED]@STATIC_CONSTANTS1] /
 
 the problem with this is that we need to repeat the
 @com.company.Constants
 always. So is there a simple way to get this working? I wanted to try out
 S:bean and s:Push... but no luck... 
 
 please help.
 
 cheers,
 ravi 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Simplified-usage-of%3A%40com.company.Constants.StaticCOnstants-tp16941171p16952906.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Context Root for Image Button src attribute

2008-04-28 Thread Yellek

I am trying to write an image button of the form:

s:submit type=image src=context-root/images/search1.gif name=search/

where context-root is the configured context root of my web application. Can
anyone suggest a good way to dynamically populate the context root?

I am assuming that the src string is being interpreted via OGNL but I can't
figure out an appropriate expression to use to extract the context root from
the request.


-- 
View this message in context: 
http://www.nabble.com/Context-Root-for-Image-Button-src-attribute-tp16952908p16952908.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Simplified usage of:@com.company.Constants.StaticCOnstants

2008-04-28 Thread Chris Pratt
I think it may need to be:

s:set name=C value=@com.company.Constants@ /

s:property value=#C.staticconstant /

But I haven't tried it myself.
  (*Chris*)


On Mon, Apr 28, 2008 at 9:44 PM, ravi_eze [EMAIL PROTECTED] wrote:

  hi,

  i tried this way:
  s:set name=C value=@com.company.Constants /

  s:property value=[EMAIL PROTECTED] /

  but its not working nor it throws an exception if its wrong way of doing.

  any help?

  cheers,
  ravi





  Wes Wannemacher wrote:
  
  
   http://struts.apache.org/2.x/docs/set.html
  
  
  
   On Mon, 2008-04-28 at 08:17 -0700, ravi_eze wrote:
   hi,
  
   we want to access the constants in our jsp page. So we are proceeding as
   follows:
  
s:text field name=[EMAIL PROTECTED]@STATIC_CONSTANTS1] /
  
   the problem with this is that we need to repeat the
   @com.company.Constants
   always. So is there a simple way to get this working? I wanted to try out
   S:bean and s:Push... but no luck...
  
   please help.
  
   cheers,
   ravi
  
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  

  --
  View this message in context: 
 http://www.nabble.com/Simplified-usage-of%3A%40com.company.Constants.StaticCOnstants-tp16941171p16952906.html

 Sent from the Struts - User mailing list archive at Nabble.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]



[Struts2] Exception starting filter (Connection Timed Out)

2008-04-28 Thread Pierre Thibaudeau
Just moving from Struts1 to Struts2.0.11.

No problem on Tomcat 6.0.16.
However, I get the following exception on startup with Tomcat 6.0.14.

Does anyone know a way round this?
(I've included excerpts from web.xml further down.)

***
EXCEPTION TRACE:
***

2008/04/29 00:59:30 | Apr 29, 2008 12:59:30 AM
org.apache.catalina.core.StandardContext filterStart
2008/04/29 00:59:30 | SEVERE: Exception starting filter action2
2008/04/29 00:59:30 | [unknown location]
2008/04/29 00:59:30 |   at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:835)
2008/04/29 00:59:30 |   at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131)
2008/04/29 00:59:30 |   at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100)
2008/04/29 00:59:30 |   at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130)
2008/04/29 00:59:30 |   at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
2008/04/29 00:59:30 |   at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
2008/04/29 00:59:30 |   at
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
2008/04/29 00:59:30 |   at
org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.ApplicationFilterConfig.init(ApplicationFilterConfig.java:108)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3696)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4343)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
2008/04/29 00:59:30 |   at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
2008/04/29 00:59:30 |   at
org.apache.catalina.startup.Catalina.start(Catalina.java:566)
2008/04/29 00:59:30 |   at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2008/04/29 00:59:30 |   at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2008/04/29 00:59:30 |   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2008/04/29 00:59:30 |   at java.lang.reflect.Method.invoke(Method.java:597)
2008/04/29 00:59:30 |   at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
2008/04/29 00:59:30 |   at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2008/04/29 00:59:30 |   at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2008/04/29 00:59:30 |   at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2008/04/29 00:59:30 |   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2008/04/29 00:59:30 |   at java.lang.reflect.Method.invoke(Method.java:597)
2008/04/29 00:59:30 |   at
org.tanukisoftware.wrapper.WrapperStartStopApp.run(WrapperStartStopApp.java:238)
2008/04/29 00:59:30 |   at java.lang.Thread.run(Thread.java:619)
2008/04/29 00:59:30 | Caused by: Connection timed out - [unknown location]
2008/04/29 00:59:30 |   at
com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123)
2008/04/29 00:59:30 |   at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830)
2008/04/29 00:59:30 |   ... 31 more
2008/04/29 00:59:30 | Caused by: java.net.ConnectException: Connection timed
out
2008/04/29 00:59:30 |   at java.net.PlainSocketImpl.socketConnect(Native
Method)
2008/04/29 00:59:30 |   at
java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
2008/04/29 00:59:30 |   at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
2008/04/29 00:59:30 |   at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
2008/04/29 00:59:30 |   at java.net.Socket.connect(Socket.java:518)
2008/04/29 00:59:30 |   at java.net.Socket.connect(Socket.java:468)
2008/04/29 00:59:30 |   at
sun.net.NetworkClient.doConnect(NetworkClient.java:157)
2008/04/29 00:59:30 |   at

RE: Simplified usage of:@com.company.Constants.StaticCOnstants

2008-04-28 Thread Ravichandra C
Hi,

This doesn't seem to be working. My main problem is that why is it not
throwing any exceptions if its not the right way to display it?

Any other way of fixing this issue??? 

Ravi 

-Original Message-
From: Chris Pratt [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 29, 2008 10:40 AM
To: Struts Users Mailing List
Subject: Re: Simplified usage of:@com.company.Constants.StaticCOnstants

I think it may need to be:

s:set name=C value=@com.company.Constants@ /

s:property value=#C.staticconstant /

But I haven't tried it myself.
  (*Chris*)


On Mon, Apr 28, 2008 at 9:44 PM, ravi_eze [EMAIL PROTECTED]
wrote:

  hi,

  i tried this way:
  s:set name=C value=@com.company.Constants /

  s:property value=[EMAIL PROTECTED] /

  but its not working nor it throws an exception if its wrong way of
doing.

  any help?

  cheers,
  ravi





  Wes Wannemacher wrote:
  
  
   http://struts.apache.org/2.x/docs/set.html
  
  
  
   On Mon, 2008-04-28 at 08:17 -0700, ravi_eze wrote:
   hi,
  
   we want to access the constants in our jsp page. So we are
proceeding as
   follows:
  
s:text field
name=[EMAIL PROTECTED]@STATIC_CONSTANTS1] /
  
   the problem with this is that we need to repeat the
   @com.company.Constants
   always. So is there a simple way to get this working? I wanted to
try out
   S:bean and s:Push... but no luck...
  
   please help.
  
   cheers,
   ravi
  
  
  
  
  
-
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  

  --
  View this message in context:
http://www.nabble.com/Simplified-usage-of%3A%40com.company.Constants.Sta
ticCOnstants-tp16941171p16952906.html

 Sent from the Struts - User mailing list archive at Nabble.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]

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



Re: devMode + Windows + Eclipse + Tomcat = not reloading struts.xml

2008-04-28 Thread Al Sutton
I'm pretty sure it's an Windows/Eclipse thing as I see the same thing with 
or without devMode set to true on Windows with JDK 1.5.0_14.


Struts has very little control over how it is deployed into the webapp 
container (tomcat in your case), so you might want to check in with the 
eclipse guys to see what they say.


Al.

- Original Message - 
From: Chase [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, April 29, 2008 1:36 AM
Subject: Re: devMode + Windows + Eclipse + Tomcat = not reloading struts.xml



Adam Hardy wrote:

Chase on 28/04/08 22:14, wrote:

Anyone had issues with devMode not working fully on Windows?

I've got constant name=struts.devMode value=true / set and in my 
Tomcat console log I'm seeing:
INFO: Overriding property struts.configuration.xml.reload - old value: 
false new value: true


Windows XP
Sun JDK 1.6u6
Eclipse 3.3.2
Tomcat 6.0.16

Tomcat is being controlled and deployed to by Eclipse.


Not fully working? Is it showing any devMode signs? ResourceBundle? 
struts.xml? Extra logging?


Yes, for instance I'm getting the Struts Problem Report page instead of 
the basic 404 pages. I haven't check ResourceBundles yet. Same project and 
versions of Struts/Tomcat/Eclipse on a Linux box work with no problem. I'm 
just not seeing struts.xml reloading on Windows systems.


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