Re: html:button

2007-02-27 Thread Romu

html:button property=ok value=Ok onclick=validateSomething() /

n


2007/2/26, Michael Jouravlev [EMAIL PROTECTED]:


I have no idea, but does it work without Javascript assigned to the
button?

On 2/25/07, Strachan, Paul [EMAIL PROTECTED] wrote:
 Hi,

 I realise this is probably not a struts problem and I feel a bit silly
posting this question but here goes:

 I'm using html:button with EventDispatchAction but my button properties
do not appear in the request - the html source fragment goes something like:

 script type=text/javascript
   function doEdit(id) {
 document.TeachingMethodForm.teachingMethodId.value=id;
 document.TeachingMethodForm.submit();
   }
 /script
 form name=TeachingMethodForm method=post
action=/eat3/admin/teachingMethods.do
   input type=hidden name=applicationId value=486
   input type=hidden name=teachingMethodId value=
 ...
  td
input type=button name=edit value=Edit
onclick=javascript:doEdit('100');
  /td
 ...
 /form

 Using Firefox the request header looks like:

 http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
 POST /eat3/admin/teachingMethods.do HTTP/1.1
 Host: xxx.xxx.43.6:8988
 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2)
Gecko/20070219 Firefox/2.0.0.2
 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9
,text/plain;q=0.8,image/png,*/*;q=0.5
 Accept-Language: en-us,en;q=0.5
 Accept-Encoding: gzip,deflate
 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
 Keep-Alive: 300
 Proxy-Connection: keep-alive
 Referer: http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
 Cookie: JSESSIONID=996b2b06231c8176feb489f64b56816acb4b73a11148
 Content-Type: application/x-www-form-urlencoded
 Content-Length: 144
 applicationId=486teachingMethodId=100
 HTTP/1.x 200 OK
 Transfer-Encoding: chunked
 Date: Mon, 26 Feb 2007 07:40:07 GMT
 Content-Type: text/html;charset=windows-1252
 Server: Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)
 Content-Location:
http://xxx.xxx.43.6:8988/eat3/WEB-INF/jsps/set_layout/layout.jsp
 Via: 1.1 ugcpx03 (NetCache NetApp/6.0.5)

 I am expecting to see edit=Edit in the request and I dont understand
why its not there.  This is contrary to the taglib documentation.

 Any hints?

 Thanks,
 Paul

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




Re: [S2] The performance issue about OGNL

2007-02-27 Thread Shuai Zheng

Dear All,

Thanks very much for useful help.

Just fight with this for 24 hours and get some improvement.

I want to apology first because I am so stupid. Last evening I do a
profiling again. The OGNL is not the main bottleneck, but it is still a
problem.

My previous page loading is around 3-5 seconds. Now it is around 1-2
seconds.

First of all, when I saw Vlad's email, I copy out the template and delete
the original from struts-core.jar. It looks well (but I forget to compare
the timing, later i will do it again)

Then I rewrite the page again and enable the DEBUG in log4j to trace it.

Something what I found:
struts.configuration.xml.reload: this parameter in the properties file will
give another 0.3 second to loading time in my case (it is so bad, that I
think it should be mentioned in the document that this feature should be
disabled in production, because you know, in struts.properties of  showcase,
it is enabled.).

There is a list in my page, which includes around 800+ items, I want to show
them in a select list. Previously I get it from database by Hibernate and
directly pass it to the component, this will cause 1 second to finish
construct this select component.
   s:select
   list=prodList
   multiple=true
   listKey=idkey
   listValue=prodName
   /
Now I loop it in the class and convert it into a MapString, String, then
pass the map to the select, it get around 1 second faster.

Regards,

Zheng Shuai

On 2/26/07, Vlad2006 [EMAIL PROTECTED] wrote:



Hi Zheng,

Have you profiled your application? Are you sure it is OGNL that makes
your
application slow?

From my experience it is not so slow. At least I have not found it too be
a
bottleneck in my application. Not yet :-).

What is really slow in WebWork/Struts2 is jsp tags like, textfield, radio,
anchor, and other which are using FreeMarker templates.

If it is your case, you could make it faster, you have to extract
templates
out of webwork.jar (in your case probably struts.jar) and put them in, for
example, WEB-INF/templates directory.
There is a page on WebWork Wiki about it:
http://wiki.opensymphony.com/display/WW/Performance+Tuning

I am not using Struts2 yet, but I believe most of the tips will work for
Struts2.

One more thing that could make application slower is when resource bundles
are constantly reloaded. It is good for dev but not acceptable for
production. Check in struts property like: webwork.i18n.reload=false


Best regards
Vlad



Shuai Zheng wrote:

 Dear All,

 I am using struts 2.0.6, but honestly the performance is very bad (not
 need
 to think about scalability), to speed to load a simple page is much
slower
 than pure JSP (I haven't compared with struts 1). To refresh one page it
 is
 3-5 seconds with only one user. The profiler tells me the OGNL is the
 bottleneck.

 I notice that there are some complains on OGNL about the performance
 already, may I know any other way to replace OGNL with anything else to
 get
 a faster speed? Currently the speed is not acceptable for production.

 Regards,

 Zheng Shuai



--
View this message in context:
http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
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: html:button

2007-02-27 Thread Romu

try with html tag may be ?

html:button property=ok value=Ok onclick=validateSomething() /





2007/2/27, Romu [EMAIL PROTECTED]:


html:button property=ok value=Ok onclick=validateSomething() /




2007/2/26, Michael Jouravlev [EMAIL PROTECTED]:

 I have no idea, but does it work without Javascript assigned to the
 button?

 On 2/25/07, Strachan, Paul [EMAIL PROTECTED] wrote:
  Hi,
 
  I realise this is probably not a struts problem and I feel a bit silly
 posting this question but here goes:
 
  I'm using html:button with EventDispatchAction but my button
 properties do not appear in the request - the html source fragment goes
 something like:
 
  script type=text/javascript
function doEdit(id) {
  document.TeachingMethodForm.teachingMethodId.value=id;
  document.TeachingMethodForm.submit();
}
  /script
  form name=TeachingMethodForm method=post
 action=/eat3/admin/teachingMethods.do
input type=hidden name=applicationId value=486
input type=hidden name=teachingMethodId value=
  ...
   td
 input type=button name=edit value=Edit
 onclick=javascript:doEdit('100');
   /td
  ...
  /form
 
  Using Firefox the request header looks like:
 
  http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
  POST /eat3/admin/teachingMethods.do HTTP/1.1
  Host: xxx.xxx.43.6:8988
  User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2)
 Gecko/20070219 Firefox/2.0.0.2
  Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9
 ,text/plain;q=0.8,image/png,*/*;q=0.5
  Accept-Language: en-us,en;q=0.5
  Accept-Encoding: gzip,deflate
  Accept-Charset: ISO-8859-1,utf-8;q= 0.7,*;q=0.7
  Keep-Alive: 300
  Proxy-Connection: keep-alive
  Referer: http://xxx.xxx.43.6:8988/eat3/admin/teachingMethods.do
  Cookie: JSESSIONID=996b2b06231c8176feb489f64b56816acb4b73a11148
  Content-Type: application/x-www-form-urlencoded
  Content-Length: 144
  applicationId=486teachingMethodId=100
  HTTP/1.x 200 OK
  Transfer-Encoding: chunked
  Date: Mon, 26 Feb 2007 07:40:07 GMT
  Content-Type: text/html;charset=windows-1252
  Server: Oracle Application Server Containers for J2EE 10g (10.1.2.0.0)
  Content-Location:
 http://xxx.xxx.43.6:8988/eat3/WEB-INF/jsps/set_layout/layout.jsp
  Via: 1.1 ugcpx03 (NetCache NetApp/6.0.5)
 
  I am expecting to see edit=Edit in the request and I dont understand
 why its not there.  This is contrary to the taglib documentation.
 
  Any hints?
 
  Thanks,
  Paul

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





struts and bulk inserts

2007-02-27 Thread Praveen, Galagali \(IE10\)
Hi,

I have a scenario where my form can contain large number of rows say 100
(or even more ) and each row contains some fields. There is a save
operation that needs to be done on this data which basically puts as 100
records in database . Since there is only going to be one formbean for a
form how this can be handled ? Is there a smart way where I can insert
all records in one go ?

Thanks in advance,
Praveen

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



How to make the file to download when clicking on a link

2007-02-27 Thread Satheesh
How to make the file to download when clicking on a link using JSP...

Please send me the code...


Re: How to make the file to download when clicking on a link

2007-02-27 Thread Prithivirajan Dhamodharan

follow the below steps

For HttpServletResponse set the

response.setContentType(.) ;
response.setHeader(Content-Disposition,attachment;filename=\ + s2
+ \)

//s2-- is file
   if required set Pragma  cache-control in header.

name
response.setContentLength()  //file length;

Get the output  stream of HttpServleResponse ,
bufferedoutputstream = new BufferedOutputStream(httpservletresponse
   .getOutputStream());

Write the content and close the stream.


On 2/27/07, Satheesh [EMAIL PROTECTED] wrote:


How to make the file to download when clicking on a link using JSP...

Please send me the code...



Validator question

2007-02-27 Thread Tom Bednarz
I have a FormBean derived from ValidatorActionForm. I define validation 
rules for certain properties in validation.xml.


No I like to add some additional validations which depend on user input. 
I thought, I can handle this in the validate(..) method but it gets 
never called!


I implemented something like:

public class QueryTripsForm extends ValidatorActionForm
{
   ...
   public ActionErrors validate(ActionMapping mapping,
javax.servlet.ServletRequest request)
   {
ActionErrors e = null;
super.validate(mapping, request);
// doing some special checks here
// ..   
return e;
   }
   
}

Why is this validate method never called? (validate is set to true, see 
below)


action
  input=/form/queryTrips.jsp
  name=queryTripsForm
  path=/listTrips
  scope=request
  validate=true
  type=ch.smartsol.struts.action.ListTripsAction
  forward name=Success path=/template/ShowTripsResult.jsp /
/action

Is there any way to combile 'default' validations defined in 
validation.xml with additional validations implemented in the validate() 
method??


Many thanks for your help.

Tom



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



Problem with 2.0.6

2007-02-27 Thread Piero Sartini
upgraded to 2.0.6 - now the error below is thrown when accessing an Action 
with validators.

dont know if it is important, but ajax-validation is enabled and the 
annotation looks like this:

--- code ---
   @RequiredStringValidator(message = Login is required, key 
= error.loginname.missing)
public String getLogin() {
return login;
}
--- code ---


Exec[0]: validator.doPost()
Caught OgnlException while setting property 'methodName' on 
type 'com.opensymphony.xwork2.validator.validators.RequiredStringValidator'.
ognl.NoSuchPropertyException: 
com.opensymphony.xwork2.validator.validators.RequiredStringValidator.methodName
at 
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
at 
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
at 
com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
at 
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
at 
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:103)
at 
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:90)
at 
com.opensymphony.xwork2.ObjectFactory.buildValidator(ObjectFactory.java:234)
at 
com.opensymphony.xwork2.validator.ValidatorFactory.getValidator(ValidatorFactory.java:252)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:79)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:134)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:109)
at 
com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:96)
at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:142)
at 
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:148)
at 
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
at 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at 
com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)




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



Load MessageResource from custom file path

2007-02-27 Thread Andrzej Bengner | e-direct Polska Sp. z o.o.
Hello

I can not load MessageResources from my custom file path. I can load for
fmt:message/ taglib, but how can I do with bean:message/?

For example, here is my Struts action snippet:

URL[] urls = new URL[1];
try
{
urls[0] = new URL(file:c:/my_dir/messages/);
}
catch (MalformedURLException e)
{
log.error(Warning...);
}
URLClassLoader loader = new URLClassLoader(urls);
ResourceBundle bundle = ResourceBundle.getBundle(MessageResources, new
Locale(en), loader);
javax.servlet.jsp.jstl.core.Config.set(request.getSession(),
javax.servlet.jsp.jstl.core.Config.FMT_LOCALIZATION_CONTEXT, new
LocalizationContext(bundle ,new Locale(en)));

Of course I have file c:/my_dir/messages/MessageResources_en.properties
And in my jsp I can do this:

fmt:message key=my.key/

But if I add this to my action:

request.setAttribute(Globals.MESSAGES_KEY, bundle);
request.getSession().setAttribute(Globals.LOCALE_KEY, new Locale(en));

And this in jsp:

bean:message key=my.key/

Then I get from jsp:
java.lang.ClassCastException: java.util.PropertyResourceBundle

Anybody knows, how can I set ResourceBundle for bean:message/ taglib or
how can I convert ResourceBundle to MessageResources?

Thanx.

Regards,
Andy


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



Need Help in Applying error Style class for html:select

2007-02-27 Thread Prithivirajan Dhamodharan

In case of error in html:select property  i required to display them with
red border.

i couldn't able to apply border for html combo box. but able to change other
properties like fonts, color of text inside combo box

Suggest me with best solution.


Re: Strange problem with Validators in Struts 1.2.9

2007-02-27 Thread Dave Newton
--- Tom Bednarz [EMAIL PROTECTED] wrote:
 I still do not feel very comfortable with writing 
 that many actions around 'CRUDing' an object.

I generally use a single action for CRUD. You may want
to look at DispatchAction (or something like that,
it's been awhile) and consider the GET/POST division
of labor I mentioned.

d.



 

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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



[s2] ww-1747

2007-02-27 Thread Mike Baroukh


Hi.

I actually have a bug on 2.0.6 related to this ticket that is marked 
fixed in 2.0.7.
(I tried select.ftl and ContainUtil.java from trunk and it works ... no 
more exception from freemaker)


For now, I included the fix in my project but, will it be reported on 
2.0.6 branch (2.0.6.1 ???) ? Or will it be only on 2.0.7 ?


It was (still now ...) the only problem I found on my app when switching 
from 2.0.1 to 2.0.6.


Thanks.

--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

Re: Ajax Requirement

2007-02-27 Thread Musachy Barroso

If you are using the autocompleter tag, this is done already, and there is
an example on showcase. If not, you will have to do everything my hand, for
which I would recommend using a framework that already has it, like
AjaxTags, not sure if Java Web Parts has something like this also, Frank?

regards
musachy

On 2/27/07, Siva Gurusamy [EMAIL PROTECTED] wrote:


Hi,



I am new to Struts 2. I have following requirement on Ajax. Can somebody
explain me how to implement this requirement?



There is form in which there are 2 selects. One is a master select and
other
is child select whose values changes based on master select. I want to
implement in Ajax. This is similar to having 2 selects one with Country
and
other with states. Based on selection of Country, values in state select
changes.  There are also other fields in the form which will be submitted
when all the fields are entered properly.



Thanks

siva





--
Hey you! Would you help me to carry the stone? Pink Floyd


Re: [S2] Ajax Requirement

2007-02-27 Thread Tim Azzopardi

i dont think struts2 provides any specific support for this. DWR (not part of
struts2) is very good at doing what you describe if you need to go to the
server to get the States list each time you change the Country. 


siva-2 wrote:
 
 Hi,
 
 I am new to Struts 2. I have following requirement on Ajax. Can somebody
 explain me how to implement this requirement?
 
 
 There is form in which there are 2 selects. One is a master select and
 other
 is child select whose values changes based on master select. I want to
 implement in Ajax. This is similar to having 2 selects one with Country
 and
 other with states. Based on selection of Country, values in state select
 changes.  There are also other fields in the form which will be submitted
 when all the fields are entered properly.
 
  
 
 Thanks
 
 siva
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Ajax-Requirement-tf3298487.html#a9181777
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: 1.2.9 html:action

2007-02-27 Thread Jim Reynolds

I guess when I was working with 1.2.4 a while back, I did things like
document.form.element.name.submit, etc. Not using the dom.

I was trying to convert to 1.2.9 and I guess I ended up with xhtml type.

Makes sense, thanks for the info.



On 2/26/07, Laurie Harper [EMAIL PROTECTED] wrote:

Jim Reynolds wrote:
 Hello,

 I am using the following in a jsp view:
   html:form name=GalleryForm action=galleries
html:hidden property=onPage /

 And the source renders:
   form id=GalleryForm method=post action=/galleries.html
input type=hidden name=onPage value=1 /

 Which works, but the source no longer gives me a form
 name=GalleryForm element like the 1.2.4 that I was used to using.

 If there anyway I can get that to work?

 Thanks,

I believe that's a function of whether you're in XHTML mode or not. In
XHTML mode, the 'name' attribute is omitted in accordance with the
recommendations of the specification. Why do you need it?

L.


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




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



Re: Ajax Requirement

2007-02-27 Thread Frank W. Zammetti
JWP doesn't offer ready-made components such as this (yet!!), but it 
*does* make developing them very simple (and without you having to code 
Javascript usually)... this particular case is actually one of our 
cookbook examples, so I suppose you could in fact say it offer this 
particular item :)


Frank

Musachy Barroso wrote:
If you are using the autocompleter tag, this is done already, and 
there is

an example on showcase. If not, you will have to do everything my hand, for
which I would recommend using a framework that already has it, like
AjaxTags, not sure if Java Web Parts has something like this also, Frank?

regards
musachy

On 2/27/07, Siva Gurusamy [EMAIL PROTECTED] wrote:


Hi,



I am new to Struts 2. I have following requirement on Ajax. Can somebody
explain me how to implement this requirement?



There is form in which there are 2 selects. One is a master select and
other
is child select whose values changes based on master select. I want to
implement in Ajax. This is similar to having 2 selects one with Country
and
other with states. Based on selection of Country, values in state select
changes.  There are also other fields in the form which will be submitted
when all the fields are entered properly.



Thanks

siva







--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

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



struts sub-modules and file upload

2007-02-27 Thread Massimiliano Cuccia
Hi allI'm using struts 1.3.5 and I defined a struts sub module (a new 
struts-config-mymodule.xml), when I try to call an action of the mymodule 
module to upload a file I get Corrupt form data: premature ending . If I 
define the action inside the default module it works.There is a bug somewhere 
in struts or am i wrong?thanks for any help
_
Prova Live.com: una sola home page per avere a portata di mano tutte le tue 
informazioni.
http://www.live.com/

Re: [S2] The performance issue about OGNL

2007-02-27 Thread Shuai Zheng

Dear All,

Still do research on the debug log and try to get performance improvement,
because I try to beat another .net system on speed(it can shows all the
pages in 0.5 second,sigh).

One more thing I just find out, if the log does not cheat me:)

Although I have enabled the property template_update_delay=6 in
freemarker.properties and also move the template out the jar file.
So there are a lot of log like:
[freemarker.cache]http-8080-Processor24
template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
using cached.
So it looks correct. But also, there are something like followings:

Could not find template in cache, creating new one;
id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]
template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
using cached.
Above logs occur in the log again and again. I don't know what happened
actually but it shows the hidden.ftl is not cached at all (how can this
happens? when some others are cached?)

Regards,

Zheng Shuai


On 2/26/07, Vlad2006 [EMAIL PROTECTED] wrote:



Hi Zheng,

Have you profiled your application? Are you sure it is OGNL that makes
your
application slow?

From my experience it is not so slow. At least I have not found it too be
a
bottleneck in my application. Not yet :-).

What is really slow in WebWork/Struts2 is jsp tags like, textfield, radio,
anchor, and other which are using FreeMarker templates.

If it is your case, you could make it faster, you have to extract
templates
out of webwork.jar (in your case probably struts.jar) and put them in, for
example, WEB-INF/templates directory.
There is a page on WebWork Wiki about it:
http://wiki.opensymphony.com/display/WW/Performance+Tuning

I am not using Struts2 yet, but I believe most of the tips will work for
Struts2.

One more thing that could make application slower is when resource bundles
are constantly reloaded. It is good for dev but not acceptable for
production. Check in struts property like: webwork.i18n.reload=false


Best regards
Vlad



Shuai Zheng wrote:

 Dear All,

 I am using struts 2.0.6, but honestly the performance is very bad (not
 need
 to think about scalability), to speed to load a simple page is much
slower
 than pure JSP (I haven't compared with struts 1). To refresh one page it
 is
 3-5 seconds with only one user. The profiler tells me the OGNL is the
 bottleneck.

 I notice that there are some complains on OGNL about the performance
 already, may I know any other way to replace OGNL with anything else to
 get
 a faster speed? Currently the speed is not acceptable for production.

 Regards,

 Zheng Shuai



--
View this message in context:
http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
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: [S2] The performance issue about OGNL

2007-02-27 Thread Shuai Zheng

One more thing, this only happens on template/xhtml/hidden.ftl.

Should I report this as a bug?

On 2/27/07, Shuai Zheng [EMAIL PROTECTED] wrote:


Dear All,

Still do research on the debug log and try to get performance improvement,
because I try to beat another .net system on speed(it can shows all the
pages in 0.5 second,sigh).

One more thing I just find out, if the log does not cheat me:)

Although I have enabled the property template_update_delay=6 in
freemarker.properties and also move the template out the jar file.
So there are a lot of log like:
[freemarker.cache]http-8080-Processor24
template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
using cached.
So it looks correct. But also, there are something like followings:

Could not find template in cache, creating new one;
id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]
template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
using cached.
Above logs occur in the log again and again. I don't know what happened
actually but it shows the hidden.ftl is not cached at all (how can this
happens? when some others are cached?)

Regards,

Zheng Shuai


On 2/26/07, Vlad2006 [EMAIL PROTECTED] wrote:


 Hi Zheng,

 Have you profiled your application? Are you sure it is OGNL that makes
 your
 application slow?

 From my experience it is not so slow. At least I have not found it too
 be a
 bottleneck in my application. Not yet :-).

 What is really slow in WebWork/Struts2 is jsp tags like, textfield,
 radio,
 anchor, and other which are using FreeMarker templates.

 If it is your case, you could make it faster, you have to extract
 templates
 out of webwork.jar (in your case probably struts.jar) and put them in,
 for
 example, WEB-INF/templates directory.
 There is a page on WebWork Wiki about it:
 http://wiki.opensymphony.com/display/WW/Performance+Tuning

 I am not using Struts2 yet, but I believe most of the tips will work for
 Struts2.

 One more thing that could make application slower is when resource
 bundles
 are constantly reloaded. It is good for dev but not acceptable for
 production. Check in struts property like: webwork.i18n.reload=false


 Best regards
 Vlad



 Shuai Zheng wrote:
 
  Dear All,
 
  I am using struts 2.0.6, but honestly the performance is very bad (not
  need
  to think about scalability), to speed to load a simple page is much
 slower
  than pure JSP (I haven't compared with struts 1). To refresh one page
 it
  is
  3-5 seconds with only one user. The profiler tells me the OGNL is the
  bottleneck.
 
  I notice that there are some complains on OGNL about the performance
  already, may I know any other way to replace OGNL with anything else
 to
  get
  a faster speed? Currently the speed is not acceptable for production.
 
  Regards,
 
  Zheng Shuai
 
 

 --
 View this message in context:
 http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
 Sent from the Struts - User mailing list archive at Nabble.com.


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





Struts 2 Action Classes (HELP!)

2007-02-27 Thread Paul Saumets | Merge
I'm having some difficulty passing along params from my action forms with 
Struts 2. I have a basic jsp form declared as follows:

s:form id=loginForm action=executeLogin validate=true nomespace=/
s:textfield id=c_username name=userName required=true /
s:password id=c_password name=userPassword required=true/
s:submit name=login key=button.login /
/s:form

executeLogin is correctly mapped to my LoginAction action class which looks 
something like the following:

public class LoginAction extends ActionSupport {

private UserService service;
private String userName;
private String userPassword;

// service injected via Spring

public LoginAction(UserService service) {
this.service = service;
}

public void setUserName(String userName) {
this.userName = userName;
}

/* remaining setters  getters below */

public String execute() {

Boolean ret = service.validateUser(getUserName(), 
getUserPassword());

/// more follow up code here
}
}


My understanding of the Struts 2 framework is that when my action is called the 
setters on the Action class will be called as well storing my passed along form 
vars? Am I wrong on this? What exactly am I doing wrong? Should I implementing 
sessionAware and then having to access the request object?

From reading the Mailreader example I see setters in for username and password 
in the MailreaderSupport base class so I don't see why the above isn't working.

Would be great to get some feedback!

Regards,
Paul

RE: How to make the file to download when clicking on a link --use DownloadAction in struts 1.2.8

2007-02-27 Thread Raghu
In Struts 1.2.8 we have DownloadAction  

write a class that extends extends DownloadAction 

implement folloing meyhod
-
import org.apache.struts.actions.DownloadAction;
public class TestDownloadAction extends DownloadAction  {
  protected StreamInfo getStreamInfo(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response)
throws FileNotFoundException,CAcsException,Exception {


 File file  = new File(c:\\test.csv);
 

 
strContentType=text/csv; // set MIME type for csv file

  return new FileStreamInfo(strContentType, file);

}//end of getStreamInfo
}//end of TestDownloadAction  class


-Original Message-
From: Prithivirajan Dhamodharan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 27, 2007 3:56 PM
To: Struts Users Mailing List
Subject: Re: How to make the file to download when clicking on a link


follow the below steps

For HttpServletResponse set the

 response.setContentType(.) ;
 response.setHeader(Content-Disposition,attachment;filename=\ + s2
+ \)

//s2-- is file
if required set Pragma  cache-control in header.

 name
 response.setContentLength()  //file length;

Get the output  stream of HttpServleResponse ,
 bufferedoutputstream = new BufferedOutputStream(httpservletresponse
.getOutputStream());

Write the content and close the stream.


On 2/27/07, Satheesh [EMAIL PROTECTED] wrote:

 How to make the file to download when clicking on a link using JSP...

 Please send me the code...



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



Re: [S2] The performance issue about OGNL

2007-02-27 Thread Shuai Zheng

Sorry to disturb again.

This issue is because default the s:hidden tag will use xhtml as theme, but
actually in the distribution, there is no template/xhtml/hidden.ftl. It
always get from template/simple/hidden.ftl. But the cache does not know it.
Then this template is recompiled again and again.

Will report it to JIRA.

A bad news for me, just know my target .net project response time is around
0.3 second. Any suggestion to improve the speed? If I use apache work with
tomcat or any web server, can I get faster speed?

Regards,

Zheng Shuai

On 2/27/07, Shuai Zheng [EMAIL PROTECTED] wrote:


One more thing, this only happens on template/xhtml/hidden.ftl.

Should I report this as a bug?

On 2/27/07, Shuai Zheng  [EMAIL PROTECTED] wrote:

 Dear All,

 Still do research on the debug log and try to get performance
 improvement, because I try to beat another .net system on speed(it can shows
 all the pages in 0.5 second,sigh).

 One more thing I just find out, if the log does not cheat me:)

 Although I have enabled the property template_update_delay=6 in
 freemarker.properties and also move the template out the jar file.
 So there are a lot of log like:
 [freemarker.cache]http-8080-Processor24
 template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
 using cached.
 So it looks correct. But also, there are something like followings:

 Could not find template in cache, creating new one;
 id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]
 template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet
 stale; using cached.
 Above logs occur in the log again and again. I don't know what happened
 actually but it shows the hidden.ftl is not cached at all (how can this
 happens? when some others are cached?)

 Regards,

 Zheng Shuai


 On 2/26/07, Vlad2006  [EMAIL PROTECTED] wrote:
 
 
  Hi Zheng,
 
  Have you profiled your application? Are you sure it is OGNL that makes
  your
  application slow?
 
  From my experience it is not so slow. At least I have not found it too
  be a
  bottleneck in my application. Not yet :-).
 
  What is really slow in WebWork/Struts2 is jsp tags like, textfield,
  radio,
  anchor, and other which are using FreeMarker templates.
 
  If it is your case, you could make it faster, you have to extract
  templates
  out of webwork.jar (in your case probably struts.jar) and put them in,
  for
  example, WEB-INF/templates directory.
  There is a page on WebWork Wiki about it:
  http://wiki.opensymphony.com/display/WW/Performance+Tuning
 
  I am not using Struts2 yet, but I believe most of the tips will work
  for
  Struts2.
 
  One more thing that could make application slower is when resource
  bundles
  are constantly reloaded. It is good for dev but not acceptable for
  production. Check in struts property like: webwork.i18n.reload=false
 
 
  Best regards
  Vlad
 
 
 
  Shuai Zheng wrote:
  
   Dear All,
  
   I am using struts 2.0.6, but honestly the performance is very bad
  (not
   need
   to think about scalability), to speed to load a simple page is much
  slower
   than pure JSP (I haven't compared with struts 1). To refresh one
  page it
   is
   3-5 seconds with only one user. The profiler tells me the OGNL is
  the
   bottleneck.
  
   I notice that there are some complains on OGNL about the performance
   already, may I know any other way to replace OGNL with anything else
  to
   get
   a faster speed? Currently the speed is not acceptable for
  production.
  
   Regards,
  
   Zheng Shuai
  
  
 
  --
  View this message in context:
  
http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
  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: [S2] The performance issue about OGNL

2007-02-27 Thread Tom Schneider

This is not a bug per se.  The xhtml theme extends the simple theme.
If a template doesn't exist in the xhtml theme it will fall back the
simple theme.  From a performance perspective, you simple need to copy
the simple theme hidden.ftl to the xhtml directory.  This will allow
freemarker to cache it properly.

On 2/27/07, Shuai Zheng [EMAIL PROTECTED] wrote:

Sorry to disturb again.

This issue is because default the s:hidden tag will use xhtml as theme, but
actually in the distribution, there is no template/xhtml/hidden.ftl. It
always get from template/simple/hidden.ftl. But the cache does not know it.
Then this template is recompiled again and again.

Will report it to JIRA.

A bad news for me, just know my target .net project response time is around
0.3 second. Any suggestion to improve the speed? If I use apache work with
tomcat or any web server, can I get faster speed?

Regards,

Zheng Shuai

On 2/27/07, Shuai Zheng [EMAIL PROTECTED] wrote:

 One more thing, this only happens on template/xhtml/hidden.ftl.

 Should I report this as a bug?

 On 2/27/07, Shuai Zheng  [EMAIL PROTECTED] wrote:
 
  Dear All,
 
  Still do research on the debug log and try to get performance
  improvement, because I try to beat another .net system on speed(it can shows
  all the pages in 0.5 second,sigh).
 
  One more thing I just find out, if the log does not cheat me:)
 
  Although I have enabled the property template_update_delay=6 in
  freemarker.properties and also move the template out the jar file.
  So there are a lot of log like:
  [freemarker.cache]http-8080-Processor24
  template/xhtml/select.ftl[en_GB,UTF-8,parsed] cached copy not yet stale;
  using cached.
  So it looks correct. But also, there are something like followings:
 
  Could not find template in cache, creating new one;
  id=[template/xhtml/hidden.ftl[en_GB,UTF-8,parsed]
  template/simple/hidden.ftl[en_GB,UTF-8,parsed] cached copy not yet
  stale; using cached.
  Above logs occur in the log again and again. I don't know what happened
  actually but it shows the hidden.ftl is not cached at all (how can this
  happens? when some others are cached?)
 
  Regards,
 
  Zheng Shuai
 
 
  On 2/26/07, Vlad2006  [EMAIL PROTECTED] wrote:
  
  
   Hi Zheng,
  
   Have you profiled your application? Are you sure it is OGNL that makes
   your
   application slow?
  
   From my experience it is not so slow. At least I have not found it too
   be a
   bottleneck in my application. Not yet :-).
  
   What is really slow in WebWork/Struts2 is jsp tags like, textfield,
   radio,
   anchor, and other which are using FreeMarker templates.
  
   If it is your case, you could make it faster, you have to extract
   templates
   out of webwork.jar (in your case probably struts.jar) and put them in,
   for
   example, WEB-INF/templates directory.
   There is a page on WebWork Wiki about it:
   http://wiki.opensymphony.com/display/WW/Performance+Tuning
  
   I am not using Struts2 yet, but I believe most of the tips will work
   for
   Struts2.
  
   One more thing that could make application slower is when resource
   bundles
   are constantly reloaded. It is good for dev but not acceptable for
   production. Check in struts property like: webwork.i18n.reload=false
  
  
   Best regards
   Vlad
  
  
  
   Shuai Zheng wrote:
   
Dear All,
   
I am using struts 2.0.6, but honestly the performance is very bad
   (not
need
to think about scalability), to speed to load a simple page is much
   slower
than pure JSP (I haven't compared with struts 1). To refresh one
   page it
is
3-5 seconds with only one user. The profiler tells me the OGNL is
   the
bottleneck.
   
I notice that there are some complains on OGNL about the performance
already, may I know any other way to replace OGNL with anything else
   to
get
a faster speed? Currently the speed is not acceptable for
   production.
   
Regards,
   
Zheng Shuai
   
   
  
   --
   View this message in context:
   
http://www.nabble.com/The-performance-issue-about-OGNL-tf3291137.html#a9157447
   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: struts sub-modules and file upload

2007-02-27 Thread Massimiliano Cuccia
GOT IT!! -- the problem was due to incompatibility between struts modules and 
common Oreilly servlet (cos). -- No problems using MultipartRequestHandler! -- 
bye -- Hi allI'm using struts 1.3.5 and I defined a struts sub module (a new 
struts-config-mymodule.xml), when I try to call an action of the mymodule 
module to upload a file I get Corrupt form data: premature ending . If I 
define the action inside the default module it works.There is a bug somewhere 
in struts or am i wrong?thanks for any help
_
Prova Live.com: il tuo mondo on line, con notizie, sport, meteo e molto altro 
ancora.
http://www.live.com/

Re: Struts 2 Action Classes (HELP!)

2007-02-27 Thread Gabe Hamilton

I believe the Parameters Interceptor will call your setUserName() method.  I
would check that that interceptor is in the stack used for LoginAction.

-Gabe

On 2/27/07, Paul Saumets | Merge [EMAIL PROTECTED] wrote:


I'm having some difficulty passing along params from my action forms with
Struts 2. I have a basic jsp form declared as follows:

s:form id=loginForm action=executeLogin validate=true
nomespace=/
s:textfield id=c_username name=userName required=true /
s:password id=c_password name=userPassword required=true/
s:submit name=login key=button.login /
/s:form

executeLogin is correctly mapped to my LoginAction action class which
looks something like the following:

public class LoginAction extends ActionSupport {

private UserService service;
private String userName;
private String userPassword;

// service injected via Spring

public LoginAction(UserService service) {
this.service = service;
}

public void setUserName(String userName) {
this.userName = userName;
}

/* remaining setters  getters below */

public String execute() {

Boolean ret = service.validateUser(getUserName(),
getUserPassword());

/// more follow up code here
}
}


My understanding of the Struts 2 framework is that when my action is
called the setters on the Action class will be called as well storing my
passed along form vars? Am I wrong on this? What exactly am I doing wrong?
Should I implementing sessionAware and then having to access the request
object?

From reading the Mailreader example I see setters in for username and
password in the MailreaderSupport base class so I don't see why the above
isn't working.

Would be great to get some feedback!

Regards,
Paul


RE: [S2] Struts 2 Action Classes (HELP!)

2007-02-27 Thread Paul Saumets | Merge
Could we explain this good example then?

http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html

Here we can see there is a form (index.jsp) calling the save() action on the 
PersonAction class.

The first call on the save action is the service.save(person).

Where does the Person person object inside PersonAction get set?
Somehow the Person setters are being called and I'm not understanding how those 
setters are automatically called yet my LoginAction setters where userName and 
userPassword are passed from the form are not?!

Could anyone explain please? ;)

-Original Message-
From: Gabe Hamilton [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 27, 2007 11:44 AM
To: Struts Users Mailing List
Subject: Re: Struts 2 Action Classes (HELP!)

I believe the Parameters Interceptor will call your setUserName() method.  I
would check that that interceptor is in the stack used for LoginAction.

-Gabe

On 2/27/07, Paul Saumets | Merge [EMAIL PROTECTED] wrote:

 I'm having some difficulty passing along params from my action forms with
 Struts 2. I have a basic jsp form declared as follows:

 s:form id=loginForm action=executeLogin validate=true
 nomespace=/
 s:textfield id=c_username name=userName required=true /
 s:password id=c_password name=userPassword required=true/
 s:submit name=login key=button.login /
 /s:form

 executeLogin is correctly mapped to my LoginAction action class which
 looks something like the following:

 public class LoginAction extends ActionSupport {

 private UserService service;
 private String userName;
 private String userPassword;

 // service injected via Spring

 public LoginAction(UserService service) {
 this.service = service;
 }

 public void setUserName(String userName) {
 this.userName = userName;
 }

 /* remaining setters  getters below */

 public String execute() {

 Boolean ret = service.validateUser(getUserName(),
 getUserPassword());

 /// more follow up code here
 }
 }


 My understanding of the Struts 2 framework is that when my action is
 called the setters on the Action class will be called as well storing my
 passed along form vars? Am I wrong on this? What exactly am I doing wrong?
 Should I implementing sessionAware and then having to access the request
 object?

 From reading the Mailreader example I see setters in for username and
 password in the MailreaderSupport base class so I don't see why the above
 isn't working.

 Would be great to get some feedback!

 Regards,
 Paul




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



Re: Struts 2 Action Classes (HELP!)

2007-02-27 Thread Nuwan Chandrasoma

Hi,

can we see your struts.xml?

Thanks,

Nuwan.


- Original Message - 
From: Paul Saumets | Merge [EMAIL PROTECTED]

To: user@struts.apache.org
Sent: Tuesday, February 27, 2007 2:50 PM
Subject: Struts 2 Action Classes (HELP!)


I'm having some difficulty passing along params from my action forms with 
Struts 2. I have a basic jsp form declared as follows:


s:form id=loginForm action=executeLogin validate=true nomespace=/
s:textfield id=c_username name=userName required=true /
s:password id=c_password name=userPassword required=true/
s:submit name=login key=button.login /
/s:form

executeLogin is correctly mapped to my LoginAction action class which looks 
something like the following:


public class LoginAction extends ActionSupport {

   private UserService service;
   private String userName;
   private String userPassword;

   // service injected via Spring

   public LoginAction(UserService service) {
   this.service = service;
   }

   public void setUserName(String userName) {
   this.userName = userName;
   }

   /* remaining setters  getters below */

   public String execute() {

   Boolean ret = service.validateUser(getUserName(), 
getUserPassword());


   /// more follow up code here
   }
}


My understanding of the Struts 2 framework is that when my action is called 
the setters on the Action class will be called as well storing my passed 
along form vars? Am I wrong on this? What exactly am I doing wrong? Should I 
implementing sessionAware and then having to access the request object?


From reading the Mailreader example I see setters in for username and 
password in the MailreaderSupport base class so I don't see why the above 
isn't working.


Would be great to get some feedback!

Regards,
Paul 



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



Problems using spring plugin and struts 2.0.6

2007-02-27 Thread João Vieira da Luz

We've upgraded to struts 2.0.6 and we can't make spring-plugin work.

The spring factory isn't being called and we are getting
ClassNotFoundException for the beans that reference spring.

This is working with struts 2.0.1.

What changed?

Thanks a lot,

  João

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



RE: Problems using spring plugin and struts 2.0.6

2007-02-27 Thread Paul Saumets | Merge
Perhaps obvious question but,

Do you have

constant name=struts.objectFactory value=spring /

set inside your struts.xml?

-Original Message-
From: João Vieira da Luz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 27, 2007 12:42 PM
To: user@struts.apache.org
Subject: Problems using spring plugin and struts 2.0.6

We've upgraded to struts 2.0.6 and we can't make spring-plugin work.

The spring factory isn't being called and we are getting
ClassNotFoundException for the beans that reference spring.

This is working with struts 2.0.1.

What changed?

Thanks a lot,

   João

-
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: Problems using spring plugin and struts 2.0.6

2007-02-27 Thread João Vieira da Luz

We use that property struts.properties:
struts.objectFactory = spring

This same configuration works well on struts 2.0.1.

A part of the stacktrace:
[2007-56-27 05:56:27] ERROR (XWorkConverter.java:645) Conversion
registration error
java.lang.ClassNotFoundException: enumTypeConverter
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1352)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
at 
com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:147)
at 
com.opensymphony.xwork2.ObjectFactory.getClassInstance(ObjectFactory.java:98)
at 
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151)
at 
com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:141)
at 
com.opensymphony.xwork2.util.XWorkConverter.createTypeConverter(XWorkConverter.java:621)
at 
com.opensymphony.xwork2.util.XWorkConverter.loadConversionProperties(XWorkConverter.java:639)
at 
com.opensymphony.xwork2.util.AnnotationXWorkConverter.init(AnnotationXWorkConverter.java:106)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

On 2/27/07, Paul Saumets | Merge [EMAIL PROTECTED] wrote:

Perhaps obvious question but,

Do you have

constant name=struts.objectFactory value=spring /

set inside your struts.xml?

-Original Message-
From: João Vieira da Luz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 27, 2007 12:42 PM
To: user@struts.apache.org
Subject: Problems using spring plugin and struts 2.0.6

We've upgraded to struts 2.0.6 and we can't make spring-plugin work.

The spring factory isn't being called and we are getting
ClassNotFoundException for the beans that reference spring.

This is working with struts 2.0.1.

What changed?

Thanks a lot,

   João

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



FileUploadInterceptor not intercepting

2007-02-27 Thread String Larson


I'm trying to get file upload working (struts 2.0.5).
It seems that FilterDispatcher.prepareAndWrapRequest is not creating  
the MultiPartRequestWrapper as required by FileUploadInterceptor.


prepareAndWrapRequest is just skipping the wrapping.

Is this a configuration issue ?

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



Scriptlets in Struts tag

2007-02-27 Thread Chaudhary, Harsh
My code:

logic:iterate name=FDA3Form property=dependentsInfoAl id=element
indexId=indexVal 
html:text name=element property=dependentName size=20
maxlength=35 indexed=true style=display:block;
styleId='BLABLABLA-%= indexVal %-'/
/logic:iterate

The code within the - and - is not working. I think it
might be due to the way the tag is parsed in the JSP but does anyone
know of a way to do this.

Basically, I would like to have id='BLA1', id='BLA2' .. in the
rendered HTML.

Harsh.

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



Repeat Question: Struts Profiling

2007-02-27 Thread Rahul Patel

Anybody use a good profiling tool with Struts/ Web Application?

This is a repeat question. Is this not the forum for these kind of
questions?

-RP


Re: Scriptlets in Struts tag

2007-02-27 Thread Nuwan Chandrasoma

hi,

try this code.

%=indexVal.intValue()%

Regards,

Nuwan.

- Original Message - 
From: Chaudhary, Harsh [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, February 27, 2007 6:22 PM
Subject: Scriptlets in Struts tag


My code:

logic:iterate name=FDA3Form property=dependentsInfoAl id=element
indexId=indexVal 
html:text name=element property=dependentName size=20

maxlength=35 indexed=true style=display:block;
styleId='BLABLABLA-%= indexVal %-'/
/logic:iterate 


The code within the - and - is not working. I think it
might be due to the way the tag is parsed in the JSP but does anyone
know of a way to do this.

Basically, I would like to have id='BLA1', id='BLA2' .. in the
rendered HTML.

Harsh.

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


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



RE: Struts 2 Action Classes (HELP!)

2007-02-27 Thread cilquirm


That example is using the null property handling feature of the XW
type-conversion system :

http://struts.apache.org/2.x/docs/type-conversion.html

Basically, when xw/ognl  sees ( evaluates )  person.firstName, it calls
getPerson() , which returns null.
XW goes to work and creates an empty Person object and places it on that
action.
and then sets firstname on that newly created person object.

(n.b. the exact ordering may be slightly off, it might set first name first
before setting person object, but the end result is the same, in this case )

I'm not sure how your spring configuration is set up, but that would be
helpful  to see.
Myself, I don't use the constructor injection mechanism, i use
autowire-by-type, so my Action doesn't have a specifically declared
constructor, just a 

setUserService(UserService us) { this.userService = us }

-a


Paul Saumets | Merge wrote:
 
 Could we explain this good example then?
 
 http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html
 
 Here we can see there is a form (index.jsp) calling the save() action on
 the PersonAction class.
 
 The first call on the save action is the service.save(person).
 
 Where does the Person person object inside PersonAction get set?
 Somehow the Person setters are being called and I'm not understanding how
 those setters are automatically called yet my LoginAction setters where
 userName and userPassword are passed from the form are not?!
 
 Could anyone explain please? ;)
 
 -Original Message-
 From: Gabe Hamilton [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 27, 2007 11:44 AM
 To: Struts Users Mailing List
 Subject: Re: Struts 2 Action Classes (HELP!)
 
 I believe the Parameters Interceptor will call your setUserName() method. 
 I
 would check that that interceptor is in the stack used for LoginAction.
 
 -Gabe
 
 On 2/27/07, Paul Saumets | Merge [EMAIL PROTECTED] wrote:

 I'm having some difficulty passing along params from my action forms with
 Struts 2. I have a basic jsp form declared as follows:

 s:form id=loginForm action=executeLogin validate=true
 nomespace=/
 s:textfield id=c_username name=userName required=true /
 s:password id=c_password name=userPassword required=true/
 s:submit name=login key=button.login /
 /s:form

 executeLogin is correctly mapped to my LoginAction action class which
 looks something like the following:

 public class LoginAction extends ActionSupport {

 private UserService service;
 private String userName;
 private String userPassword;

 // service injected via Spring

 public LoginAction(UserService service) {
 this.service = service;
 }

 public void setUserName(String userName) {
 this.userName = userName;
 }

 /* remaining setters  getters below */

 public String execute() {

 Boolean ret = service.validateUser(getUserName(),
 getUserPassword());

 /// more follow up code here
 }
 }


 My understanding of the Struts 2 framework is that when my action is
 called the setters on the Action class will be called as well storing my
 passed along form vars? Am I wrong on this? What exactly am I doing
 wrong?
 Should I implementing sessionAware and then having to access the request
 object?

 From reading the Mailreader example I see setters in for username and
 password in the MailreaderSupport base class so I don't see why the above
 isn't working.

 Would be great to get some feedback!

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

-- 
View this message in context: 
http://www.nabble.com/Struts-2-Action-Classes-%28HELP%21%29-tf3301377.html#a9188636
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: Problems using spring plugin and struts 2.0.6

2007-02-27 Thread cilquirm

Technically, this isn't necessary when you have the struts-spring-plugin.jar
in your WEB-INF/lib
since it's already specified by the struts-plugin.xml file

I think, however, seeing a more complete stack trace for the CNFE would be
helpful since I have 2.0.6 with the spring plugin just fine.




Paul Saumets | Merge wrote:
 
 Perhaps obvious question but,
 
 Do you have
 
 constant name=struts.objectFactory value=spring /
 
 set inside your struts.xml?
 
 -Original Message-
 From: João Vieira da Luz [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 27, 2007 12:42 PM
 To: user@struts.apache.org
 Subject: Problems using spring plugin and struts 2.0.6
 
 We've upgraded to struts 2.0.6 and we can't make spring-plugin work.
 
 The spring factory isn't being called and we are getting
 ClassNotFoundException for the beans that reference spring.
 
 This is working with struts 2.0.1.
 
 What changed?
 
 Thanks a lot,
 
João
 
 -
 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/Problems-using-spring-plugin-and-struts-2.0.6-tf3302939.html#a9188385
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: Scriptlets in Struts tag

2007-02-27 Thread Chaudhary, Harsh
I tried that. But in the HTML rendered, the id attribute is rendered as:

id='BLABLA%=indexVal.intValue()%'

Harsh.

-Original Message-
From: Nuwan Chandrasoma [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 27, 2007 6:09 PM
To: Struts Users Mailing List
Subject: Re: Scriptlets in Struts tag


hi,

try this code.

%=indexVal.intValue()%

Regards,

Nuwan.

- Original Message - 
From: Chaudhary, Harsh [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, February 27, 2007 6:22 PM
Subject: Scriptlets in Struts tag


My code:

logic:iterate name=FDA3Form property=dependentsInfoAl id=element
indexId=indexVal 
html:text name=element property=dependentName size=20
maxlength=35 indexed=true style=display:block;
styleId='BLABLABLA-%= indexVal %-'/
/logic:iterate 

The code within the - and - is not working. I think it
might be due to the way the tag is parsed in the JSP but does anyone
know of a way to do this.

Basically, I would like to have id='BLA1', id='BLA2' .. in the
rendered HTML.

Harsh.

-
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: [S2] Problem with 2.0.6

2007-02-27 Thread cilquirm

I see errors like that on occasion ( mine is with the JSONResult type and the
location property ), but they've always been warnings.

Is yours logged at the ERROR level?



Piero Sartini-3 wrote:
 
 upgraded to 2.0.6 - now the error below is thrown when accessing an Action 
 with validators.
 
 dont know if it is important, but ajax-validation is enabled and the 
 annotation looks like this:
 
 --- code ---
@RequiredStringValidator(message = Login is required, key 
 = error.loginname.missing)
 public String getLogin() {
 return login;
 }
 --- code ---
 
 
 Exec[0]: validator.doPost()
 Caught OgnlException while setting property 'methodName' on 
 type
 'com.opensymphony.xwork2.validator.validators.RequiredStringValidator'.
 ognl.NoSuchPropertyException: 
 com.opensymphony.xwork2.validator.validators.RequiredStringValidator.methodName
 at 
 ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
 at 
 com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
 at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
 at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
 at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
 at ognl.SimpleNode.setValue(SimpleNode.java:246)
 at ognl.Ognl.setValue(Ognl.java:476)
 at
 com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
 at 
 com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
 at 
 com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
 at 
 com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:103)
 at 
 com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:90)
 at 
 com.opensymphony.xwork2.ObjectFactory.buildValidator(ObjectFactory.java:234)
 at 
 com.opensymphony.xwork2.validator.ValidatorFactory.getValidator(ValidatorFactory.java:252)
 at 
 com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.getValidators(AnnotationActionValidatorManager.java:79)
 at 
 com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:134)
 at 
 com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:109)
 at 
 com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:96)
 at 
 com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:142)
 at 
 com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:148)
 at 
 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
 at 
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
 at 
 com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-2.0.6-tf3300246.html#a9188430
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: Scriptlets in Struts tag

2007-02-27 Thread Frank W. Zammetti
I believe your running into something I ran into the other day, something
I didn't know... if you have an attribute:

someAttribute=123%=someVar%

...the value of someVar isn't inserted.  However, if you do:

% someVar = 123 + someVar %
someAttribute=%=someVar%

...that works.  The combination of static text and a scriplet seems to not
work.  Give it a shot, see if that does the trick for you...

Frank


-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

On Tue, February 27, 2007 1:40 pm, Chaudhary, Harsh wrote:
 I tried that. But in the HTML rendered, the id attribute is rendered as:

 id='BLABLA%=indexVal.intValue()%'

 Harsh.

 -Original Message-
 From: Nuwan Chandrasoma [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 27, 2007 6:09 PM
 To: Struts Users Mailing List
 Subject: Re: Scriptlets in Struts tag


 hi,

 try this code.

 %=indexVal.intValue()%

 Regards,

 Nuwan.

 - Original Message -
 From: Chaudhary, Harsh [EMAIL PROTECTED]
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Tuesday, February 27, 2007 6:22 PM
 Subject: Scriptlets in Struts tag


 My code:

 logic:iterate name=FDA3Form property=dependentsInfoAl id=element
 indexId=indexVal
 html:text name=element property=dependentName size=20
 maxlength=35 indexed=true style=display:block;
 styleId='BLABLABLA-%= indexVal %-'/
 /logic:iterate

 The code within the - and - is not working. I think it
 might be due to the way the tag is parsed in the JSP but does anyone
 know of a way to do this.

 Basically, I would like to have id='BLA1', id='BLA2' .. in the
 rendered HTML.

 Harsh.

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




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



Re: Problems using spring plugin and struts 2.0.6

2007-02-27 Thread João Vieira da Luz

Well we've made progresses. The problem is on registering converters
on XWorkConverter.

We are trying to register converters using spring.

On application-context.xml we have this,

bean id=enumTypeConverter class=presentation.converter.EnumTypeConverter /

and on xwork-conversion.properties,

domain.security.PermissionType = enumTypeConverter

Probably is a problem from our xwork configuration, but we can't
figure out what is wrong?

How can I tell xwork that it must use a SpringClassLoader?

Thanks again,
Joao

PS: The stacktrace is pretty much what I've send you.

On 2/27/07, cilquirm [EMAIL PROTECTED] wrote:


Technically, this isn't necessary when you have the struts-spring-plugin.jar
in your WEB-INF/lib
since it's already specified by the struts-plugin.xml file

I think, however, seeing a more complete stack trace for the CNFE would be
helpful since I have 2.0.6 with the spring plugin just fine.




Paul Saumets | Merge wrote:

 Perhaps obvious question but,

 Do you have

 constant name=struts.objectFactory value=spring /

 set inside your struts.xml?

 -Original Message-
 From: João Vieira da Luz [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 27, 2007 12:42 PM
 To: user@struts.apache.org
 Subject: Problems using spring plugin and struts 2.0.6

 We've upgraded to struts 2.0.6 and we can't make spring-plugin work.

 The spring factory isn't being called and we are getting
 ClassNotFoundException for the beans that reference spring.

 This is working with struts 2.0.1.

 What changed?

 Thanks a lot,

João

 -
 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/Problems-using-spring-plugin-and-struts-2.0.6-tf3302939.html#a9188385
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: Scriptlets in Struts tag

2007-02-27 Thread Chaudhary, Harsh
Works like a charm. Thanks a lot.

My guess is that my problem could be due to the fact that anything
within attributes like styleid etc. are just parsed as a string.

Harsh.

-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 27, 2007 12:50 PM
To: Struts Users Mailing List
Cc: Struts Users Mailing List
Subject: RE: Scriptlets in Struts tag


I believe your running into something I ran into the other day,
something
I didn't know... if you have an attribute:

someAttribute=123%=someVar%

...the value of someVar isn't inserted.  However, if you do:

% someVar = 123 + someVar %
someAttribute=%=someVar%

...that works.  The combination of static text and a scriplet seems to
not
work.  Give it a shot, see if that does the trick for you...

Frank


-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

On Tue, February 27, 2007 1:40 pm, Chaudhary, Harsh wrote:
 I tried that. But in the HTML rendered, the id attribute is rendered
as:

 id='BLABLA%=indexVal.intValue()%'

 Harsh.

 -Original Message-
 From: Nuwan Chandrasoma [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 27, 2007 6:09 PM
 To: Struts Users Mailing List
 Subject: Re: Scriptlets in Struts tag


 hi,

 try this code.

 %=indexVal.intValue()%

 Regards,

 Nuwan.

 - Original Message -
 From: Chaudhary, Harsh [EMAIL PROTECTED]
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Tuesday, February 27, 2007 6:22 PM
 Subject: Scriptlets in Struts tag


 My code:

 logic:iterate name=FDA3Form property=dependentsInfoAl
id=element
 indexId=indexVal
 html:text name=element property=dependentName size=20
 maxlength=35 indexed=true style=display:block;
 styleId='BLABLABLA-%= indexVal %-'/
 /logic:iterate

 The code within the - and - is not working. I think it
 might be due to the way the tag is parsed in the JSP but does anyone
 know of a way to do this.

 Basically, I would like to have id='BLA1', id='BLA2' .. in the
 rendered HTML.

 Harsh.

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




-
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: Scriptlets in Struts tag

2007-02-27 Thread Frank W. Zammetti
I don't think so... if that was true you'd expect it to work as you first
wrote it... it seems to be the specific combination of static content in
the attribute value PLUS a scriplet (actually, I guess that's an
expression, I always forget the difference).  In any case, glad that
worked :)  I know I burned almost an hour the other day until I took a
wild guess and happened to be right.

Frank


-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

On Tue, February 27, 2007 2:16 pm, Chaudhary, Harsh wrote:
 Works like a charm. Thanks a lot.

 My guess is that my problem could be due to the fact that anything
 within attributes like styleid etc. are just parsed as a string.

 Harsh.

 -Original Message-
 From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 27, 2007 12:50 PM
 To: Struts Users Mailing List
 Cc: Struts Users Mailing List
 Subject: RE: Scriptlets in Struts tag


 I believe your running into something I ran into the other day,
 something
 I didn't know... if you have an attribute:

 someAttribute=123%=someVar%

 ...the value of someVar isn't inserted.  However, if you do:

 % someVar = 123 + someVar %
 someAttribute=%=someVar%

 ...that works.  The combination of static text and a scriplet seems to
 not
 work.  Give it a shot, see if that does the trick for you...

 Frank


 --
 Frank W. Zammetti
 Founder and Chief Software Architect
 Omnytex Technologies
 http://www.omnytex.com
 AIM/Yahoo: fzammetti
 MSN: [EMAIL PROTECTED]
 Author of Practical Ajax Projects With Java Technology
  (2006, Apress, ISBN 1-59059-695-1)
 Java Web Parts - http://javawebparts.sourceforge.net
  Supplying the wheel, so you don't have to reinvent it!

 On Tue, February 27, 2007 1:40 pm, Chaudhary, Harsh wrote:
 I tried that. But in the HTML rendered, the id attribute is rendered
 as:

 id='BLABLA%=indexVal.intValue()%'

 Harsh.

 -Original Message-
 From: Nuwan Chandrasoma [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, February 27, 2007 6:09 PM
 To: Struts Users Mailing List
 Subject: Re: Scriptlets in Struts tag


 hi,

 try this code.

 %=indexVal.intValue()%

 Regards,

 Nuwan.

 - Original Message -
 From: Chaudhary, Harsh [EMAIL PROTECTED]
 To: Struts Users Mailing List user@struts.apache.org
 Sent: Tuesday, February 27, 2007 6:22 PM
 Subject: Scriptlets in Struts tag


 My code:

 logic:iterate name=FDA3Form property=dependentsInfoAl
 id=element
 indexId=indexVal
 html:text name=element property=dependentName size=20
 maxlength=35 indexed=true style=display:block;
 styleId='BLABLABLA-%= indexVal %-'/
 /logic:iterate

 The code within the - and - is not working. I think it
 might be due to the way the tag is parsed in the JSP but does anyone
 know of a way to do this.

 Basically, I would like to have id='BLA1', id='BLA2' .. in the
 rendered HTML.

 Harsh.

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




 -
 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: [S2] Problems using spring plugin and struts 2.0.6

2007-02-27 Thread cilquirm

I'm not sure type converters are instantiated via the ObjectFactory
mechanism, but you can just as easily say :

domain.security.PermissionType = presentation.converter.EnumTypeConverter

You will probably need to refactor some code if your EnumTypeConverter
expects to be in a Spring context.



João Vieira da Luz wrote:
 
 Well we've made progresses. The problem is on registering converters
 on XWorkConverter.
 
 We are trying to register converters using spring.
 
 On application-context.xml we have this,
 
 bean id=enumTypeConverter
 class=presentation.converter.EnumTypeConverter /
 
 and on xwork-conversion.properties,
 
 domain.security.PermissionType = enumTypeConverter
 
 Probably is a problem from our xwork configuration, but we can't
 figure out what is wrong?
 
 How can I tell xwork that it must use a SpringClassLoader?
 
 Thanks again,
 Joao
 
 PS: The stacktrace is pretty much what I've send you.
 
 On 2/27/07, cilquirm [EMAIL PROTECTED] wrote:

 Technically, this isn't necessary when you have the
 struts-spring-plugin.jar
 in your WEB-INF/lib
 since it's already specified by the struts-plugin.xml file

 I think, however, seeing a more complete stack trace for the CNFE would
 be
 helpful since I have 2.0.6 with the spring plugin just fine.




 Paul Saumets | Merge wrote:
 
  Perhaps obvious question but,
 
  Do you have
 
  constant name=struts.objectFactory value=spring /
 
  set inside your struts.xml?
 
  -Original Message-
  From: João Vieira da Luz [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 27, 2007 12:42 PM
  To: user@struts.apache.org
  Subject: Problems using spring plugin and struts 2.0.6
 
  We've upgraded to struts 2.0.6 and we can't make spring-plugin work.
 
  The spring factory isn't being called and we are getting
  ClassNotFoundException for the beans that reference spring.
 
  This is working with struts 2.0.1.
 
  What changed?
 
  Thanks a lot,
 
 João
 
  -
  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/Problems-using-spring-plugin-and-struts-2.0.6-tf3302939.html#a9188385
 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/Problems-using-spring-plugin-and-struts-2.0.6-tf3302939.html#a9190615
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: [S2] Problems using spring plugin and struts 2.0.6

2007-02-27 Thread João Vieira da Luz

Ok, that's a solution. We were trying to avoid to do that...

Hope somebody could help us on this.

Thanks again,
João




On 2/27/07, cilquirm [EMAIL PROTECTED] wrote:


I'm not sure type converters are instantiated via the ObjectFactory
mechanism, but you can just as easily say :

domain.security.PermissionType = presentation.converter.EnumTypeConverter

You will probably need to refactor some code if your EnumTypeConverter
expects to be in a Spring context.



João Vieira da Luz wrote:

 Well we've made progresses. The problem is on registering converters
 on XWorkConverter.

 We are trying to register converters using spring.

 On application-context.xml we have this,

 bean id=enumTypeConverter
 class=presentation.converter.EnumTypeConverter /

 and on xwork-conversion.properties,

 domain.security.PermissionType = enumTypeConverter

 Probably is a problem from our xwork configuration, but we can't
 figure out what is wrong?

 How can I tell xwork that it must use a SpringClassLoader?

 Thanks again,
 Joao

 PS: The stacktrace is pretty much what I've send you.

 On 2/27/07, cilquirm [EMAIL PROTECTED] wrote:

 Technically, this isn't necessary when you have the
 struts-spring-plugin.jar
 in your WEB-INF/lib
 since it's already specified by the struts-plugin.xml file

 I think, however, seeing a more complete stack trace for the CNFE would
 be
 helpful since I have 2.0.6 with the spring plugin just fine.




 Paul Saumets | Merge wrote:
 
  Perhaps obvious question but,
 
  Do you have
 
  constant name=struts.objectFactory value=spring /
 
  set inside your struts.xml?
 
  -Original Message-
  From: João Vieira da Luz [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, February 27, 2007 12:42 PM
  To: user@struts.apache.org
  Subject: Problems using spring plugin and struts 2.0.6
 
  We've upgraded to struts 2.0.6 and we can't make spring-plugin work.
 
  The spring factory isn't being called and we are getting
  ClassNotFoundException for the beans that reference spring.
 
  This is working with struts 2.0.1.
 
  What changed?
 
  Thanks a lot,
 
 João
 
  -
  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/Problems-using-spring-plugin-and-struts-2.0.6-tf3302939.html#a9188385
 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/Problems-using-spring-plugin-and-struts-2.0.6-tf3302939.html#a9190615
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]



Is it possible to get Struts' FilterDispatcher to serve up static files

2007-02-27 Thread mraible

I'm using *.html as my default extension, which causes a whole host of issues
with Dojo.  Regardless, I want to fight through it and see if I can come up
with a solution.

I noticed that FilterDispatcher allows you to serve up static files from the
classpath.  Is it possible to configure this same filter so it can serve up
static .html files from a static directory in my webapp root?

Thanks,

Matt
-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-get-Struts%27-FilterDispatcher-to-serve-up-static-files-tf3304172.html#a9191128
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 it possible to get Struts' FilterDispatcher to serve up static files

2007-02-27 Thread Musachy Barroso

Quoting the doc: 

Common static content that is needed by the framework (JavaScript and CSS
files, etc.) is served automatically by the FilterDispatcher filter. Any
request starting with /struts/ denotes that static content is required,
and then mapping the value after /struts/ to common packages in Struts 2
and, optionally in the application's class path.

By default, the following packages are searched:

  - org.apache.struts2.static
  - template

Additional packages can be specified by providing a comma separated list to
the configuration parameter named packages (configured in web.xml for the
FilterDispatcher filter). When specifying additional static content, you
should be careful not to expose sensitive configuration information (i.e.
database password).
//I haven't used it myself :)
musachy

On 2/27/07, mraible [EMAIL PROTECTED] wrote:



I'm using *.html as my default extension, which causes a whole host of
issues
with Dojo.  Regardless, I want to fight through it and see if I can come
up
with a solution.

I noticed that FilterDispatcher allows you to serve up static files from
the
classpath.  Is it possible to configure this same filter so it can serve
up
static .html files from a static directory in my webapp root?

Thanks,

Matt
--
View this message in context:
http://www.nabble.com/Is-it-possible-to-get-Struts%27-FilterDispatcher-to-serve-up-static-files-tf3304172.html#a9191128
Sent from the Struts - User mailing list archive at Nabble.com.


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





--
Hey you! Would you help me to carry the stone? Pink Floyd


Re: Is it possible to get Struts' FilterDispatcher to serve up static files

2007-02-27 Thread Musachy Barroso

Is there a FAQ for S2 somewhere?

musachy

On 2/27/07, Musachy Barroso [EMAIL PROTECTED] wrote:


Quoting the doc: 

Common static content that is needed by the framework (JavaScript and CSS
files, etc.) is served automatically by the FilterDispatcher filter. Any
request starting with /struts/ denotes that static content is required,
and then mapping the value after /struts/ to common packages in Struts 2
and, optionally in the application's class path.

By default, the following packages are searched:

   - org.apache.struts2.static
   - template

Additional packages can be specified by providing a comma separated list
to the configuration parameter named packages (configured in web.xml for
the FilterDispatcher filter). When specifying additional static content, you
should be careful not to expose sensitive configuration information (i.e.
database password).
//I haven't used it myself :)
musachy

On 2/27/07, mraible  [EMAIL PROTECTED] wrote:


 I'm using *.html as my default extension, which causes a whole host of
 issues
 with Dojo.  Regardless, I want to fight through it and see if I can come
 up
 with a solution.

 I noticed that FilterDispatcher allows you to serve up static files from
 the
 classpath.  Is it possible to configure this same filter so it can serve
 up
 static .html files from a static directory in my webapp root?

 Thanks,

 Matt
 --
 View this message in context:
 
http://www.nabble.com/Is-it-possible-to-get-Struts%27-FilterDispatcher-to-serve-up-static-files-tf3304172.html#a9191128
 Sent from the Struts - User mailing list archive at Nabble.com .


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




--
Hey you! Would you help me to carry the stone? Pink Floyd





--
Hey you! Would you help me to carry the stone? Pink Floyd


Re: [S2] Is it possible to get Struts' FilterDispatcher to serve up static files

2007-02-27 Thread mraible

Right, it can serve up static content from the classpath, but I want to do it
from the webapp.

Matt


Musachy Barroso wrote:
 
 Quoting the doc: 
 
 Common static content that is needed by the framework (JavaScript and CSS
 files, etc.) is served automatically by the FilterDispatcher filter. Any
 request starting with /struts/ denotes that static content is required,
 and then mapping the value after /struts/ to common packages in Struts 2
 and, optionally in the application's class path.
 
 By default, the following packages are searched:
 
- org.apache.struts2.static
- template
 
 Additional packages can be specified by providing a comma separated list
 to
 the configuration parameter named packages (configured in web.xml for
 the
 FilterDispatcher filter). When specifying additional static content, you
 should be careful not to expose sensitive configuration information (i.e.
 database password).
 //I haven't used it myself :)
 musachy
 
 On 2/27/07, mraible [EMAIL PROTECTED] wrote:


 I'm using *.html as my default extension, which causes a whole host of
 issues
 with Dojo.  Regardless, I want to fight through it and see if I can come
 up
 with a solution.

 I noticed that FilterDispatcher allows you to serve up static files from
 the
 classpath.  Is it possible to configure this same filter so it can serve
 up
 static .html files from a static directory in my webapp root?

 Thanks,

 Matt
 --
 View this message in context:
 http://www.nabble.com/Is-it-possible-to-get-Struts%27-FilterDispatcher-to-serve-up-static-files-tf3304172.html#a9191128
 Sent from the Struts - User mailing list archive at Nabble.com.


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


 
 
 -- 
 Hey you! Would you help me to carry the stone? Pink Floyd
 
 

-- 
View this message in context: 
http://www.nabble.com/Is-it-possible-to-get-Struts%27-FilterDispatcher-to-serve-up-static-files-tf3304172.html#a9191703
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 it possible to get Struts' FilterDispatcher to serve up static files

2007-02-27 Thread Stuart Piltch
mraible matt at raibledesigns.com writes:
 I'm using *.html as my default extension, which causes a whole host of issues
 with Dojo.  Regardless, I want to fight through it and see if I can come up
 with a solution.

Hi Matt,

I'm not sure about your specific FilterDispatcher question, but we also use
*.html as a default extension. We ended up copying all the dojo html files that
we use into out own /WEB-INF/widgets directory and adding an extra
struts-dojo.xml file to our config:

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

struts
package name=dojo namespace=/struts/dojo/src/widget/templates
extends=base
action name=*
result type=plainhtml/WEB-INF/widgets/{1}.html/result
/action
/package
package name=dojoEditor2
namespace=/struts/dojo/src/widget/templates/Editor2 extends=base
action name=*
result type=plainhtml/WEB-INF/widgets/Editor2/{1}.html/result
/action
/package
package name=dojoEditor2Dialog
namespace=/struts/dojo/src/widget/templates/Editor2/Dialog extends=base
action name=*
result
type=plainhtml/WEB-INF/widgets/Editor2/Dialog/{1}.html/result
/action
/package
/struts

It seems convoluted, but it's working. The other dojo files (css, js, etc) are
working fine from within the struts jar.

Cheers,

 - stuart



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



Re: [S2] [ANN] Struts 2.0.6 GA release available

2007-02-27 Thread walidito

Congratulations !!


Pedro Herrera wrote:
 
 Congratulations  to Struts team for this release!!
 
 Best Regards 
 
 Pedo Herrera
 
 
 
 husted wrote:
 
 The Apache Struts group is pleased to announce that Struts 2.0.6 is
 available as a General Availability release. The GA designation is
 our highest quality grade.
 
 Apache Struts 2 is an elegant, extensible framework for creating
 enterprise-ready Java web applications. The framework is designed to
 streamline the full development cycle, from building, to deploying, to
 maintaining applications over time.
 
 Apache Struts 2 was originally known as WebWork 2. After working
 independently for several years, the WebWork and Struts communities
 joined forces to create Struts2. This new version of Struts is simpler
 to use and closer to how Struts was always meant to be.
 
 * Build!
   o Easy startup - Jumpstart new projects with our bootstrap tutorial
 and template application or Maven archetype.
   o Improved Design - Code clean against HTTP-independent framework
 interfaces.
   o Enhanced Tags - Code less with stylesheet-driven form tags that
 provide their own markup.
   o Stateful Checkboxes - Avoid special handling with smart checkboxes
 that know when they are toggled.
   o Flexible Cancel Buttons - Go directly to a different action on
 cancel.
   o First-class AJAX support - Add interactivity and flexibility with
 AJAX tags that look and feel just like standard Struts tags.
   o Easy Spring integration - Inject dependencies into Actions using
 Spring without glue code or red tape. (Plexus support also available.)
   o Enhanced Results - Do more with specialty results for
 JasperReports, JFreeChart, Action chaining, and file downloading.
   o POJO forms - No more ActionForms! Use any JavaBean to capture form
 input or put properties directly on an Action class. Use both binary
 and String properties!
   o POJO Actions - Use any class as an Action class -- even the
 interface is optional!
 
 * Deploy!
   o Easy plugins - Add framework extensions by dropping in a JAR. No
 manual configuration required! Bundled plugins add support for
 JavaServer Faces, JasperReports, JFreeChart, Tiles, and more ...
   o Integrated profiling - Peek inside Struts2 to find where the
 cycles are going!
   o Precise Error Reporting - Flip directly to the location and line
 of an error.
 
 * Maintain!
   o Easy-to-test Actions - Test Struts2 Actions directly, without
 resorting to mock HTTP objects.
   o Intelligent Defaults - Skip obvious and redundant settings. Most
 framework configuration elements have a default value that we can set
 and forget. Say it once!
   o Easy-to-customize controller - Customize the request handling per
 action, if desired. Struts2 only does what you want it to do!
   o Integrating Debugging - Research problem reports with built-in
 debugging tools.
   o Easy-to-tweak tags - Customize tag markup by editing a FreeMarker
 template. No need to grok the taglib API! JSP, FreeMarker, and
 Velocity tags are fully supported.
 
 Struts 2.0.6 is available in a full distribution, or as separate
 library, source, example and documentation distributions.
 
  *  http://struts.apache.org/download.cgi#struts2006
 
 The release is also available through the central Maven repository
 under Group ID org.apache.struts.
 
 The 2.0.6 series of the Apache Struts framework has a minimum
 requirement of the following specification versions:
 
  *  Servlet API 2.4
  * JSP API 2.0
  * Java 5
 
 The release notes are available online at:
 
  * http://struts.apache.org/2.x/docs/release-notes-206.html
 
 Should any issues arise with your use of any version of the Struts
 framework, please post your comments to the user list, and, if
 appropriate, file a ticket with JIRA.
 
 -- The Apache Struts group.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-ANN--Struts-2.0.6-GA-release-available-tf3282253.html#a9192570
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: [S2] JNLP with struts ?

2007-02-27 Thread Maya menon
Anyone has any idea ?
   
  I have to call a jnlp file to download some app specific files upon proper 
logon of the users. So, if a user logs in, if its  a valid user, then jnlp file 
has to be downloaded and the user's result page should appear simultaneously..
   
  Any help thoughts, appreacited
   
  Thanks

cilquirm [EMAIL PROTECTED] wrote:
  
in your resulting page
you can set

@page contentType = 'application/x-java-jnlp-file'

and return the body of your jnlp file ( possibly even read via c:import or
some such mechanism )





Maya menon wrote:
 
 Have anyone used java web start[JNLP files] with struts ?
 
 I have a project which uses struts. Now i have a Login.jsp, which calls
 Loginaction.java.
 
 If user is a valid user, then I have to initiate a call to a jnlp file
 . Have anyone done this ?
 
 basically, I want to install something in the client's machines if the
 user is a valid user of our application. The app uses Login.jsp and
 Loginaction.java now. 
 
 Any suggestions/thoughts,
 
 Maya
 
 
 -
 Be a PS3 game guru.
 Get your game face on with the latest PS3 news and previews at Yahoo!
 Games.
 

-- 
View this message in context: 
http://www.nabble.com/JNLP-with-struts---tf3280718.html#a9127299
Sent from the Struts - User mailing list archive at Nabble.com.


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



 
-
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.

Re: [s2] Validation 'magic' on 'input'

2007-02-27 Thread Laurie Harper
Just to follow up on this for the archives, there is now an even easier 
way: annotate methods for which no validation should fire with 
@SkipValidation. I believe (?) that annotation is new with 2.0.6, or at 
least it's a recent addition. Anyway, it works very well.


L.

Don Brown wrote:

Nah, there is a better way.  Take a look at the struts-default.xml
file and notice how the validation interceptor is configured to only
skip validation on certain methods.  Create a new base package that
contains a default interceptor stack which has the validation
interceptor configured differently, say to skip execute as well.
Then, use the struts.codebehind.defaultPackage setting to point the
codebehind plugin at your new parent package.

Don

On 2/12/07, Laurie Harper [EMAIL PROTECTED] wrote:

Hmm, if that's true it'll mean I'm forced to split my user admin action
into multiple actions (and same for every other master-detail view I
have) :-( Does the same limitation apply when using XML-based validation?

L.

Musachy Barroso wrote:
 I think when you annotate a class with @Validations, input is the 
only

 method that will be called without invoking the validation first.

 musachy

 Laurie Harper wrote:
 I'm trying to get validation working (using annotations) in a Struts2
 project and I can't seem to get it to quite cooperate :-) I'm using
 the Zero Configuration and Code Behind plugins, so this may be a
 result of some unintended interaction between those and the validation
 framework.

 The use case is a master/detail view, where both are handled by the
 same action. The (default) master view (/admin/users.jsp) lists all
 the users and has an Add User link pointing to
 /admin/users!add.action. The problem is, as soon as I add any
 validation rules, the action is never executed and Struts loads the
 default /admin/users.jsp view, instead of /admin/users-edit.jsp.
 Without validation rules specified (including if I have an empty
 @Validations annotation), everything works as it should.

 I've tried using an @SkipValidation annotation as mentioned on the
 Validation page [1] in the documentation, but that annotation doesn't
 seem to exist anywhere in Struts2 or XWork...!

 Now, the magic: if I add an 'input' method to the action with 'return
 edit;', and hit /admin/users!input.action (instead of ...!add...),
 it works fine again. It appears that the token 'input' is somehow 
magic?


 A stripped down copy of my action follows [2]. How do I get validation
 to *only* be applied when calling the save() method?

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

 [2] action code:

 package ...admin;
 @Results(
 @Result(value = users, type = ServletActionRedirectResult.class)
 // XXX why doesn't this work?
 )
 @Validation
 public class UsersAction extends ActionSupport {
 public String add() {
 System.out.println(ADD);
 user = userService.createUser();
 return edit;
 }

 public String execute() {
 System.out.println(EXECUTE);
 return edit;
 }

 public String input() {
 System.out.println(INPUT);
 return edit;
 }

 @Validations(
 requiredStrings = {
 @RequiredStringValidator(
 fieldName = user.login,
 key = user.login.required,
 message = user.login.required)},
 ...
 )
 public String save() {
 System.out.println(SAVE);
 ...

 return SUCCESS;
 }
 }


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



[s2] how to upgrade to 2.0.6

2007-02-27 Thread walidito

I have alreasy start my project with 2.0.1 and it is working well.
However, I'd like to upgrade to 2.0.6.
Can someone explain me how to do it ?

thanks
-- 
View this message in context: 
http://www.nabble.com/-s2--how-to-upgrade-to-2.0.6-tf3304713.html#a9192617
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: [s2] how to upgrade to 2.0.6

2007-02-27 Thread Paul Saumets
Well,

For each previous release I've just created a brand new user library (I use 
Eclipse) and imported the latest libraries from the build.

Eg.
I'll have various folders where I have unarchived the latest builds
Struts-2.0.1
Struts-2.0.4
Struts-2.0.6

In Eclipse I just create a user library for each of the builds and import the 
/lib folder in those builds to my user library.

It then simply just becomes a matter of dropping the old user library from my 
project and adding the new one to the build path.

don't know if that helps :)

Regards,
Paul
  _  

From: walidito [mailto:[EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Tue, 27 Feb 2007 16:44:43 -0500
Subject: [s2] how to upgrade to 2.0.6


  I have alreasy start my project with 2.0.1 and it is working well.
  However, I'd like to upgrade to 2.0.6.
  Can someone explain me how to do it ?
  
  thanks
  -- 
  View this message in context: 
http://www.nabble.com/-s2--how-to-upgrade-to-2.0.6-tf3304713.html#a9192617
  Sent from the Struts - User mailing list archive at Nabble.com.
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  


[S2] LoginAction - Best approach feedback?

2007-02-27 Thread Paul Saumets
 

  
  AcceptTentativeDeclineCalendar  
  
  
  AcceptTentativeDeclineCalendar  
  
Hey,

Looking for feedback on best way to implement a login action mechanism using 
Struts2/Spring/JPA

Initially I had declared userName and userPassword setters inside my action 
class and proceeded to call
a validateUser method inside my userService class.

the  userService class injects a userdao object and I validate through  calling 
the userdao method validate(String username, String password).

This  validate method instantiates a new UserEntity object and a query is  
performed (jpa) grabbing all entities where login = username (which  will be a 
single entity since username must be unique).

I have  this approach working. I would like to know if there is a better way to 
 do this though. Perhaps by declaring a UserEntity obj inside my  LoginAction 
class and having setters called for this obj.

Then I could change my validate to pass along the new UserEntity obj via 
validate(UserEntity user).
My problem is I'm not entirely sure how I would compare against data in my db 
using JPA?

Would  your validate method then have a findAll() method and then iterate  
through the list comparing against new UserEntity obj? That make sense?

That would seem very poor though to be since a large userlist could be taxing 
to iterate over.

Any guidance or tips? :)

Thanks all!

Regards,
Paul
  

Re: [S2] how to upgrade to 2.0.6

2007-02-27 Thread walidito

thanks,

When you say  library, are you talkin about the set of jars in web-inf/lib
?

If I understand well, you create a project each time ??!

Or do you always work on your old project and just update the jars ? If
so, could you please be more precise about other things that has to be
upgrades except the jars. 

thanks

Walid


Paul Saumets | Merge wrote:
 
 Well,
 
 For each previous release I've just created a brand new user library (I
 use Eclipse) and imported the latest libraries from the build.
 
 Eg.
 I'll have various folders where I have unarchived the latest builds
 Struts-2.0.1
 Struts-2.0.4
 Struts-2.0.6
 
 In Eclipse I just create a user library for each of the builds and import
 the /lib folder in those builds to my user library.
 
 It then simply just becomes a matter of dropping the old user library from
 my project and adding the new one to the build path.
 
 don't know if that helps :)
 
 Regards,
 Paul
   _  
 
 From: walidito [mailto:[EMAIL PROTECTED]
 To: user@struts.apache.org
 Sent: Tue, 27 Feb 2007 16:44:43 -0500
 Subject: [s2] how to upgrade to 2.0.6
 
 
   I have alreasy start my project with 2.0.1 and it is working well.
   However, I'd like to upgrade to 2.0.6.
   Can someone explain me how to do it ?
   
   thanks
   -- 
   View this message in context:
 http://www.nabble.com/-s2--how-to-upgrade-to-2.0.6-tf3304713.html#a9192617
   Sent from the Struts - User mailing list archive at Nabble.com.
   
   
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   
 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--how-to-upgrade-to-2.0.6-tf3304713.html#a9192942
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: [s2] Validation 'magic' on 'input'

2007-02-27 Thread Musachy Barroso

Is there any @SkipX annotation to skip populating a property by the
ParamsInterceptor?

musachy

On 2/27/07, Laurie Harper [EMAIL PROTECTED] wrote:


Just to follow up on this for the archives, there is now an even easier
way: annotate methods for which no validation should fire with
@SkipValidation. I believe (?) that annotation is new with 2.0.6, or at
least it's a recent addition. Anyway, it works very well.

L.

Don Brown wrote:
 Nah, there is a better way.  Take a look at the struts-default.xml
 file and notice how the validation interceptor is configured to only
 skip validation on certain methods.  Create a new base package that
 contains a default interceptor stack which has the validation
 interceptor configured differently, say to skip execute as well.
 Then, use the struts.codebehind.defaultPackage setting to point the
 codebehind plugin at your new parent package.

 Don

 On 2/12/07, Laurie Harper [EMAIL PROTECTED] wrote:
 Hmm, if that's true it'll mean I'm forced to split my user admin action
 into multiple actions (and same for every other master-detail view I
 have) :-( Does the same limitation apply when using XML-based
validation?

 L.

 Musachy Barroso wrote:
  I think when you annotate a class with @Validations, input is the
 only
  method that will be called without invoking the validation first.
 
  musachy
 
  Laurie Harper wrote:
  I'm trying to get validation working (using annotations) in a
Struts2
  project and I can't seem to get it to quite cooperate :-) I'm using
  the Zero Configuration and Code Behind plugins, so this may be a
  result of some unintended interaction between those and the
validation
  framework.
 
  The use case is a master/detail view, where both are handled by the
  same action. The (default) master view (/admin/users.jsp) lists all
  the users and has an Add User link pointing to
  /admin/users!add.action. The problem is, as soon as I add any
  validation rules, the action is never executed and Struts loads the
  default /admin/users.jsp view, instead of /admin/users-edit.jsp.
  Without validation rules specified (including if I have an empty
  @Validations annotation), everything works as it should.
 
  I've tried using an @SkipValidation annotation as mentioned on the
  Validation page [1] in the documentation, but that annotation
doesn't
  seem to exist anywhere in Struts2 or XWork...!
 
  Now, the magic: if I add an 'input' method to the action with
'return
  edit;', and hit /admin/users!input.action (instead of ...!add...),
  it works fine again. It appears that the token 'input' is somehow
 magic?
 
  A stripped down copy of my action follows [2]. How do I get
validation
  to *only* be applied when calling the save() method?
 
  [1] http://struts.apache.org/2.x/docs/validation.html
 
  [2] action code:
 
  package ...admin;
  @Results(
  @Result(value = users, type =
ServletActionRedirectResult.class)
  // XXX why doesn't this work?
  )
  @Validation
  public class UsersAction extends ActionSupport {
  public String add() {
  System.out.println(ADD);
  user = userService.createUser();
  return edit;
  }
 
  public String execute() {
  System.out.println(EXECUTE);
  return edit;
  }
 
  public String input() {
  System.out.println(INPUT);
  return edit;
  }
 
  @Validations(
  requiredStrings = {
  @RequiredStringValidator(
  fieldName = user.login,
  key = user.login.required,
  message = user.login.required)},
  ...
  )
  public String save() {
  System.out.println(SAVE);
  ...
 
  return SUCCESS;
  }
  }
 
 
 
-
  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]





--
Hey you! Would you help me to carry the stone? Pink Floyd


Re: Scriptlets in Struts tag

2007-02-27 Thread Laurie Harper
Yup, that's the way the spec says it should work :-) An attribute can be 
*either* a static String *or* a Runtime Expression. You can't mix both, 
so you have to make the any static text part of the RT as you showed.


L.

Frank W. Zammetti wrote:

I don't think so... if that was true you'd expect it to work as you first
wrote it... it seems to be the specific combination of static content in
the attribute value PLUS a scriplet (actually, I guess that's an
expression, I always forget the difference).  In any case, glad that
worked :)  I know I burned almost an hour the other day until I took a
wild guess and happened to be right.

Frank





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



Re: [S2] LoginAction - Best approach feedback?

2007-02-27 Thread abpicol
Are you working on this for fun or you are really intending to do this 
on an production environment? 

If you are considering a real world solution, maybe it would be 
interesting to use web-container-based authorization: I use this 
throughout my intranet site and I like it very much, because I simply 
don't *NEED* to implement authorization code inside my applications 
whatsoever: just configure the web.xml defining roles and such and 
*PRESTO!*. And with JAAS you can integrate this login method with 
virtually *ANY* preexistent authentication solution.

Hope it helps...






Paul Saumets [EMAIL PROTECTED] 
27/02/2007 18:29
Please respond to
Struts Users Mailing List user@struts.apache.org


To
user@struts.apache.org
cc

Subject
[S2] LoginAction - Best approach feedback? 






 

 
  AcceptTentativeDeclineCalendar 
 
 
  AcceptTentativeDeclineCalendar 
 
Hey,

Looking for feedback on best way to implement a login action mechanism 
using Struts2/Spring/JPA

Initially I had declared userName and userPassword setters inside my 
action class and proceeded to call
a validateUser method inside my userService class.

the  userService class injects a userdao object and I validate through 
calling the userdao method validate(String username, String password).

This  validate method instantiates a new UserEntity object and a query is 
performed (jpa) grabbing all entities where login = username (which  will 
be a single entity since username must be unique).

I have  this approach working. I would like to know if there is a better 
way to  do this though. Perhaps by declaring a UserEntity obj inside my 
LoginAction class and having setters called for this obj.

Then I could change my validate to pass along the new UserEntity obj via 
validate(UserEntity user).
My problem is I'm not entirely sure how I would compare against data in my 
db using JPA?

Would  your validate method then have a findAll() method and then iterate 
through the list comparing against new UserEntity obj? That make sense?

That would seem very poor though to be since a large userlist could be 
taxing to iterate over.

Any guidance or tips? :)

Thanks all!

Regards,
Paul
 


Re: [S2] how to upgrade to 2.0.6

2007-02-27 Thread Paul Saumets
no.

when I say library I mean all the struts2 related libraries found in the /lib 
folder of any distribution you download.
If you go and download the latest struts-2.0-6-all.zip file you should find a 
/lib folder there.

In Eclipse if you right click on one of your projects go to Properties - Java 
Build Path - Libraries tab.
From here you should be able to click Add Library... and then select User 
Library - User Libraries...

From here you should be to create your own user libraries. Create one and call 
it whatever you want (Struts-2.0.6)
and then just add all the jars found under the /lib folder where you unzip'd 
the struts distribution.

Then just add your new Struts2.0.6 library to your project. 

I dont know if I could explain it any better over email :(

Regards,
Paul
  _  

From: walidito [mailto:[EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Tue, 27 Feb 2007 17:01:38 -0500
Subject: Re: [S2] how to upgrade to 2.0.6


  thanks,
  
  When you say  library, are you talkin about the set of jars in web-inf/lib
  ?
  
  If I understand well, you create a project each time ??!
  
  Or do you always work on your old project and just update the jars ? If
  so, could you please be more precise about other things that has to be
  upgrades except the jars. 
  
  thanks
  
  Walid
  
  
  Paul Saumets | Merge wrote:
   
   Well,
   
   For each previous release I've just created a brand new user library (I
   use Eclipse) and imported the latest libraries from the build.
   
   Eg.
   I'll have various folders where I have unarchived the latest builds
   Struts-2.0.1
   Struts-2.0.4
   Struts-2.0.6
   
   In Eclipse I just create a user library for each of the builds and import
   the /lib folder in those builds to my user library.
   
   It then simply just becomes a matter of dropping the old user library from
   my project and adding the new one to the build path.
   
   don't know if that helps :)
   
   Regards,
   Paul
 _  
   
   From: walidito [mailto:[EMAIL PROTECTED]
   To: user@struts.apache.org
   Sent: Tue, 27 Feb 2007 16:44:43 -0500
   Subject: [s2] how to upgrade to 2.0.6
   
   
 I have alreasy start my project with 2.0.1 and it is working well.
 However, I'd like to upgrade to 2.0.6.
 Can someone explain me how to do it ?
 
 thanks
 -- 
 View this message in context:
   http://www.nabble.com/-s2--how-to-upgrade-to-2.0.6-tf3304713.html#a9192617
 Sent from the Struts - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
   
   
  
  -- 
  View this message in context: 
http://www.nabble.com/-s2--how-to-upgrade-to-2.0.6-tf3304713.html#a9192942
  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: [S2] how to upgrade to 2.0.6

2007-02-27 Thread walidito

Ok thank you very much for this concrete explaination. I got it.
The only think I'm still wondering, is if what you describe is enough to
upgrade because this looks (too) easy...
Of course I know you can not figure all the possible problems that can
happen, but if you or somebody could give other files to change or to
modify, it would be great to know before I migrate.

thanks

Walid


Paul Saumets | Merge wrote:
 
 no.
 
 when I say library I mean all the struts2 related libraries found in the
 /lib folder of any distribution you download.
 If you go and download the latest struts-2.0-6-all.zip file you should
 find a /lib folder there.
 
 In Eclipse if you right click on one of your projects go to Properties -
 Java Build Path - Libraries tab.
 From here you should be able to click Add Library... and then select User
 Library - User Libraries...
 
 From here you should be to create your own user libraries. Create one and
 call it whatever you want (Struts-2.0.6)
 and then just add all the jars found under the /lib folder where you
 unzip'd the struts distribution.
 
 Then just add your new Struts2.0.6 library to your project. 
 
 I dont know if I could explain it any better over email :(
 
 Regards,
 Paul
   _  
 
 From: walidito [mailto:[EMAIL PROTECTED]
 To: user@struts.apache.org
 Sent: Tue, 27 Feb 2007 17:01:38 -0500
 Subject: Re: [S2] how to upgrade to 2.0.6
 
 
   thanks,
   
   When you say  library, are you talkin about the set of jars in
 web-inf/lib
   ?
   
   If I understand well, you create a project each time ??!
   
   Or do you always work on your old project and just update the jars ?
 If
   so, could you please be more precise about other things that has to be
   upgrades except the jars. 
   
   thanks
   
   Walid
   
   
   Paul Saumets | Merge wrote:

Well,

For each previous release I've just created a brand new user library
 (I
use Eclipse) and imported the latest libraries from the build.

Eg.
I'll have various folders where I have unarchived the latest builds
Struts-2.0.1
Struts-2.0.4
Struts-2.0.6

In Eclipse I just create a user library for each of the builds and
 import
the /lib folder in those builds to my user library.

It then simply just becomes a matter of dropping the old user library
 from
my project and adding the new one to the build path.

don't know if that helps :)

Regards,
Paul
  _  

From: walidito [mailto:[EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Tue, 27 Feb 2007 16:44:43 -0500
Subject: [s2] how to upgrade to 2.0.6


  I have alreasy start my project with 2.0.1 and it is working well.
  However, I'd like to upgrade to 2.0.6.
  Can someone explain me how to do it ?
  
  thanks
  -- 
  View this message in context:
   
 http://www.nabble.com/-s2--how-to-upgrade-to-2.0.6-tf3304713.html#a9192617
  Sent from the Struts - User mailing list archive at Nabble.com.
  
  
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  


   
   -- 
   View this message in context:
 http://www.nabble.com/-s2--how-to-upgrade-to-2.0.6-tf3304713.html#a9192942
   Sent from the Struts - User mailing list archive at Nabble.com.
   
   
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   
 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--how-to-upgrade-to-2.0.6-tf3304713.html#a9193398
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 and bulk inserts

2007-02-27 Thread Laurie Harper

Praveen, Galagali (IE10) wrote:

Hi,

I have a scenario where my form can contain large number of rows say 100
(or even more ) and each row contains some fields. There is a save
operation that needs to be done on this data which basically puts as 100
records in database . Since there is only going to be one formbean for a
form how this can be handled ? Is there a smart way where I can insert
all records in one go ?


I'm not sure what you're looking for guidance on, but perhaps the 
following will help. If you have multiple rows, each of which is 
composed of the same set of data, you can use indexed properties on your 
form bean to capture that data. That takes care of capturing multiple 
records with a single form bean.


As to how you then transfer those records into your database, that would 
depend on what persistence technology you're using and how your 
architecture is set up for transferring data between the view tier and 
the backend database.


L.


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



[S2] Single quote in package.properties

2007-02-27 Thread Eric Rank

This should be an easy one.

When putting a single quote in a package.properties resource bundle  
entry, by default, the quote get's removed and none of the variables  
in the entry get loaded.


1. What's the best way to have an entry with a single quote?
Using apos; with s:property value=%{message} escape=false /  
works, but is this the only way?


2. What are the rules behind how the single quotes work in the  
package.properties files? Said differently, what's the intended and  
expected behavior of a string with a single quote?


=

For example, in the package.properties file:

message.myMessage=I've added a single quote in the first word. and  
this variable {0} will not get populated


renders as:

Ive added a single quote in the first word. and this variable {0}  
will not get populated


when I expect:

I've added a single quote in the first word. and this variable  
VariableSentIn will not get populated


=

Thanks!

Eric Rank

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



Re: Validator question

2007-02-27 Thread Laurie Harper

Tom Bednarz wrote:
I have a FormBean derived from ValidatorActionForm. I define validation 
rules for certain properties in validation.xml.


No I like to add some additional validations which depend on user input. 
I thought, I can handle this in the validate(..) method but it gets 
never called!


I implemented something like:

public class QueryTripsForm extends ValidatorActionForm
{
   ...
   public ActionErrors validate(ActionMapping mapping,
javax.servlet.ServletRequest request)
   {
ActionErrors e = null;
super.validate(mapping, request);
// doing some special checks here
// ..   
return e;

   }
   
}


That looks OK. Are you sure you want to extend ValidatorActionForm 
rather than just ValidatorForm? The effect is subtly different. You 
haven't posted your validation config, so I can't tell which would be 
correct for your useage.


Why is this validate method never called? (validate is set to true, see 
below)


action
  input=/form/queryTrips.jsp
  name=queryTripsForm
  path=/listTrips
  scope=request
  validate=true
  type=ch.smartsol.struts.action.ListTripsAction
  forward name=Success path=/template/ShowTripsResult.jsp /
/action


How is the form declared in struts-config.xml? What URL are you 
accessing? Assuming your form is declared with the name 'queryTripsForm' 
and you're actually hitting this action mapping, validate() should be 
getting called I think.


Is there any way to combile 'default' validations defined in 
validation.xml with additional validations implemented in the validate() 
method??


Yes, with a slight correction to your code above:

ActionErrors e = super.validate(mapping, request);

You need to capture the errors from the 'default' validation process or 
they'll be discarded.


L.


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



Re: [S2] Single quote in package.properties

2007-02-27 Thread abpicol
It really is, Eric.

package.properties is nothing more than a standard java.util.Properties 
file. See the javadoc for this class and you get this question answered, 
and will see many more interesting things ;-)

Alexander





Eric Rank [EMAIL PROTECTED] 
27/02/2007 19:32
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
[S2] Single quote in package.properties






This should be an easy one.

When putting a single quote in a package.properties resource bundle 
entry, by default, the quote get's removed and none of the variables 
in the entry get loaded.

1. What's the best way to have an entry with a single quote?
Using apos; with s:property value=%{message} escape=false / 
works, but is this the only way?

2. What are the rules behind how the single quotes work in the 
package.properties files? Said differently, what's the intended and 
expected behavior of a string with a single quote?

=

For example, in the package.properties file:

message.myMessage=I've added a single quote in the first word. and 
this variable {0} will not get populated

renders as:

Ive added a single quote in the first word. and this variable {0} 
will not get populated

when I expect:

I've added a single quote in the first word. and this variable 
VariableSentIn will not get populated

=

Thanks!

Eric Rank

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




Re: Load MessageResource from custom file path

2007-02-27 Thread Laurie Harper
The ususal way to expose resource bundles for use with Struts1 is to 
include the properties files in the webapp's classpath, configure them 
in struts-config.xml and let Struts deal with loading them. Is there a 
reason you need to store the files external to the webapp and load them 
manually?


If you really do need to do that, you'll have to have your loading code 
take care of loading the properties into the appropriate bundle type too.


L.

Andrzej Bengner | e-direct Polska Sp. z o.o. wrote:

Hello

I can not load MessageResources from my custom file path. I can load for
fmt:message/ taglib, but how can I do with bean:message/?

For example, here is my Struts action snippet:

URL[] urls = new URL[1];
try
{
urls[0] = new URL(file:c:/my_dir/messages/);
}
catch (MalformedURLException e)
{
log.error(Warning...);
}
URLClassLoader loader = new URLClassLoader(urls);
ResourceBundle bundle = ResourceBundle.getBundle(MessageResources, new
Locale(en), loader);
javax.servlet.jsp.jstl.core.Config.set(request.getSession(),
javax.servlet.jsp.jstl.core.Config.FMT_LOCALIZATION_CONTEXT, new
LocalizationContext(bundle ,new Locale(en)));

Of course I have file c:/my_dir/messages/MessageResources_en.properties
And in my jsp I can do this:

fmt:message key=my.key/

But if I add this to my action:

request.setAttribute(Globals.MESSAGES_KEY, bundle);
request.getSession().setAttribute(Globals.LOCALE_KEY, new Locale(en));

And this in jsp:

bean:message key=my.key/

Then I get from jsp:
java.lang.ClassCastException: java.util.PropertyResourceBundle

Anybody knows, how can I set ResourceBundle for bean:message/ taglib or
how can I convert ResourceBundle to MessageResources?

Thanx.

Regards,
Andy



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



Re: [s2] ww-1747

2007-02-27 Thread Laurie Harper

Mike Baroukh wrote:


Hi.

I actually have a bug on 2.0.6 related to this ticket that is marked 
fixed in 2.0.7.
(I tried select.ftl and ContainUtil.java from trunk and it works ... no 
more exception from freemaker)


For now, I included the fix in my project but, will it be reported on 
2.0.6 branch (2.0.6.1 ???) ? Or will it be only on 2.0.7 ?


It was (still now ...) the only problem I found on my app when switching 
from 2.0.1 to 2.0.6.


2.0.7 will be the next release after 2.0.6. Struts doesn't offer 'minor 
patch' releases like 2.0.6.1. So, the fix will be included in the next 
release, which is 2.0.7.


HTH,

L.


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



Re: [S2] how to upgrade to 2.0.6

2007-02-27 Thread Laurie Harper
See the release notes for detailed info on what's changed between 
releases. That should tell you what, if anything, needs to change in 
your project:


http://struts.apache.org/2.x/docs/release-notes-202.html
http://struts.apache.org/2.x/docs/release-notes-203.html
http://struts.apache.org/2.x/docs/release-notes-204.html
http://struts.apache.org/2.x/docs/release-notes-205.html
http://struts.apache.org/2.x/docs/release-notes-206.html

Pay particular attention to any 'Backward compatibility issues with 
prior development release' sections. In general, these should cover 
most/all of what you need to worry about with respect to changing your 
application.


L.

walidito wrote:

thanks,

When you say  library, are you talkin about the set of jars in web-inf/lib
?

If I understand well, you create a project each time ??!

Or do you always work on your old project and just update the jars ? If
so, could you please be more precise about other things that has to be
upgrades except the jars. 


thanks

Walid


Paul Saumets | Merge wrote:

Well,

For each previous release I've just created a brand new user library (I
use Eclipse) and imported the latest libraries from the build.

Eg.
I'll have various folders where I have unarchived the latest builds
Struts-2.0.1
Struts-2.0.4
Struts-2.0.6

In Eclipse I just create a user library for each of the builds and import
the /lib folder in those builds to my user library.

It then simply just becomes a matter of dropping the old user library from
my project and adding the new one to the build path.

don't know if that helps :)

Regards,
Paul
  _  


From: walidito [mailto:[EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Tue, 27 Feb 2007 16:44:43 -0500
Subject: [s2] how to upgrade to 2.0.6


  I have alreasy start my project with 2.0.1 and it is working well.
  However, I'd like to upgrade to 2.0.6.
  Can someone explain me how to do it ?
  
  thanks
  -- 
  View this message in context:

http://www.nabble.com/-s2--how-to-upgrade-to-2.0.6-tf3304713.html#a9192617
  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: [S2] The performance issue about OGNL

2007-02-27 Thread Ted Husted

On 2/27/07, Shuai Zheng [EMAIL PROTECTED] wrote:

First of all, when I saw Vlad's email, I copy out the template and delete
the original from struts-core.jar.


You shouldn't have to delete the one in the JAR. The one under WEB-INF
is earlier on the classpath, and it's first come first served.

Thanks very much for the detailed followup.

-Ted.

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



Re: [s2] Validation 'magic' on 'input'

2007-02-27 Thread Laurie Harper
Doesn't look like it, though I'd mostly want to apply such an annotation 
to properties I *don't* have, so I wouldn't get all those OGNL warnings 
logged with huge stack traces! ;-)


Musachy Barroso wrote:

Is there any @SkipX annotation to skip populating a property by the
ParamsInterceptor?

musachy

On 2/27/07, Laurie Harper [EMAIL PROTECTED] wrote:


Just to follow up on this for the archives, there is now an even easier
way: annotate methods for which no validation should fire with
@SkipValidation. I believe (?) that annotation is new with 2.0.6, or at
least it's a recent addition. Anyway, it works very well.

L.

Don Brown wrote:
 Nah, there is a better way.  Take a look at the struts-default.xml
 file and notice how the validation interceptor is configured to only
 skip validation on certain methods.  Create a new base package that
 contains a default interceptor stack which has the validation
 interceptor configured differently, say to skip execute as well.
 Then, use the struts.codebehind.defaultPackage setting to point the
 codebehind plugin at your new parent package.

 Don

 On 2/12/07, Laurie Harper [EMAIL PROTECTED] wrote:
 Hmm, if that's true it'll mean I'm forced to split my user admin 
action

 into multiple actions (and same for every other master-detail view I
 have) :-( Does the same limitation apply when using XML-based
validation?

 L.

 Musachy Barroso wrote:
  I think when you annotate a class with @Validations, input is the
 only
  method that will be called without invoking the validation first.
 
  musachy
 
  Laurie Harper wrote:
  I'm trying to get validation working (using annotations) in a
Struts2
  project and I can't seem to get it to quite cooperate :-) I'm using
  the Zero Configuration and Code Behind plugins, so this may be a
  result of some unintended interaction between those and the
validation
  framework.
 
  The use case is a master/detail view, where both are handled by the
  same action. The (default) master view (/admin/users.jsp) lists all
  the users and has an Add User link pointing to
  /admin/users!add.action. The problem is, as soon as I add any
  validation rules, the action is never executed and Struts loads the
  default /admin/users.jsp view, instead of /admin/users-edit.jsp.
  Without validation rules specified (including if I have an empty
  @Validations annotation), everything works as it should.
 
  I've tried using an @SkipValidation annotation as mentioned on the
  Validation page [1] in the documentation, but that annotation
doesn't
  seem to exist anywhere in Struts2 or XWork...!
 
  Now, the magic: if I add an 'input' method to the action with
'return
  edit;', and hit /admin/users!input.action (instead of 
...!add...),

  it works fine again. It appears that the token 'input' is somehow
 magic?
 
  A stripped down copy of my action follows [2]. How do I get
validation
  to *only* be applied when calling the save() method?
 
  [1] http://struts.apache.org/2.x/docs/validation.html
 
  [2] action code:
 
  package ...admin;
  @Results(
  @Result(value = users, type =
ServletActionRedirectResult.class)
  // XXX why doesn't this work?
  )
  @Validation
  public class UsersAction extends ActionSupport {
  public String add() {
  System.out.println(ADD);
  user = userService.createUser();
  return edit;
  }
 
  public String execute() {
  System.out.println(EXECUTE);
  return edit;
  }
 
  public String input() {
  System.out.println(INPUT);
  return edit;
  }
 
  @Validations(
  requiredStrings = {
  @RequiredStringValidator(
  fieldName = user.login,
  key = user.login.required,
  message = user.login.required)},
  ...
  )
  public String save() {
  System.out.println(SAVE);
  ...
 
  return SUCCESS;
  }
  }
 
 
 
-
  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]








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



Re: [S2] Single quote in package.properties

2007-02-27 Thread Eric Rank

Thanks Alexander,

I still think I'm missing something though. From the Javadoc:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html

snip
Escapes are not necessary for single and double quotes; however, by  
the rule above, single and double quote characters preceded by a  
backslash still yield single and double quote characters, respectively.

/snip

This would suggest that a single quote would be fine and appear as  
expected. However, since single quotes disappear, this suggests to me  
that struts2 is doing something a little more. Any ideas?


Thanks,

Eric




On Feb 27, 2007, at 3:42 PM, [EMAIL PROTECTED] wrote:


It really is, Eric.

package.properties is nothing more than a standard  
java.util.Properties
file. See the javadoc for this class and you get this question  
answered,

and will see many more interesting things ;-)

Alexander





Eric Rank [EMAIL PROTECTED]
27/02/2007 19:32
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
[S2] Single quote in package.properties






This should be an easy one.

When putting a single quote in a package.properties resource bundle
entry, by default, the quote get's removed and none of the variables
in the entry get loaded.

1. What's the best way to have an entry with a single quote?
Using apos; with s:property value=%{message} escape=false /
works, but is this the only way?

2. What are the rules behind how the single quotes work in the
package.properties files? Said differently, what's the intended and
expected behavior of a string with a single quote?

=

For example, in the package.properties file:

message.myMessage=I've added a single quote in the first word. and
this variable {0} will not get populated

renders as:

Ive added a single quote in the first word. and this variable {0}
will not get populated

when I expect:

I've added a single quote in the first word. and this variable
VariableSentIn will not get populated

=



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



Validator validWhen

2007-02-27 Thread jmpdev
Hi,

 

I would like to know if it is possible to call validWhen on the client
side?

I didn't find validWhen.js is it possible to find it somewhere?

 

Thanks,

Regards, Jean-Marie.



Re: [s2] Validation 'magic' on 'input'

2007-02-27 Thread Musachy Barroso

I could use it for security reasons, like populating an object model
directly, but making sure that nobody sets the id property for example. I
know I can do it using ParameterNameAware, but having an annotation would be
nicer.

musachy

On 2/27/07, Laurie Harper [EMAIL PROTECTED] wrote:


Doesn't look like it, though I'd mostly want to apply such an annotation
to properties I *don't* have, so I wouldn't get all those OGNL warnings
logged with huge stack traces! ;-)

Musachy Barroso wrote:
 Is there any @SkipX annotation to skip populating a property by the
 ParamsInterceptor?

 musachy

 On 2/27/07, Laurie Harper [EMAIL PROTECTED] wrote:

 Just to follow up on this for the archives, there is now an even easier
 way: annotate methods for which no validation should fire with
 @SkipValidation. I believe (?) that annotation is new with 2.0.6, or at
 least it's a recent addition. Anyway, it works very well.

 L.

 Don Brown wrote:
  Nah, there is a better way.  Take a look at the struts-default.xml
  file and notice how the validation interceptor is configured to only
  skip validation on certain methods.  Create a new base package that
  contains a default interceptor stack which has the validation
  interceptor configured differently, say to skip execute as well.
  Then, use the struts.codebehind.defaultPackage setting to point the
  codebehind plugin at your new parent package.
 
  Don
 
  On 2/12/07, Laurie Harper [EMAIL PROTECTED] wrote:
  Hmm, if that's true it'll mean I'm forced to split my user admin
 action
  into multiple actions (and same for every other master-detail view I
  have) :-( Does the same limitation apply when using XML-based
 validation?
 
  L.
 
  Musachy Barroso wrote:
   I think when you annotate a class with @Validations, input is
the
  only
   method that will be called without invoking the validation first.
  
   musachy
  
   Laurie Harper wrote:
   I'm trying to get validation working (using annotations) in a
 Struts2
   project and I can't seem to get it to quite cooperate :-) I'm
using
   the Zero Configuration and Code Behind plugins, so this may be a
   result of some unintended interaction between those and the
 validation
   framework.
  
   The use case is a master/detail view, where both are handled by
the
   same action. The (default) master view (/admin/users.jsp) lists
all
   the users and has an Add User link pointing to
   /admin/users!add.action. The problem is, as soon as I add any
   validation rules, the action is never executed and Struts loads
the
   default /admin/users.jsp view, instead of /admin/users-edit.jsp.
   Without validation rules specified (including if I have an empty
   @Validations annotation), everything works as it should.
  
   I've tried using an @SkipValidation annotation as mentioned on
the
   Validation page [1] in the documentation, but that annotation
 doesn't
   seem to exist anywhere in Struts2 or XWork...!
  
   Now, the magic: if I add an 'input' method to the action with
 'return
   edit;', and hit /admin/users!input.action (instead of
 ...!add...),
   it works fine again. It appears that the token 'input' is somehow
  magic?
  
   A stripped down copy of my action follows [2]. How do I get
 validation
   to *only* be applied when calling the save() method?
  
   [1] http://struts.apache.org/2.x/docs/validation.html
  
   [2] action code:
  
   package ...admin;
   @Results(
   @Result(value = users, type =
 ServletActionRedirectResult.class)
   // XXX why doesn't this work?
   )
   @Validation
   public class UsersAction extends ActionSupport {
   public String add() {
   System.out.println(ADD);
   user = userService.createUser();
   return edit;
   }
  
   public String execute() {
   System.out.println(EXECUTE);
   return edit;
   }
  
   public String input() {
   System.out.println(INPUT);
   return edit;
   }
  
   @Validations(
   requiredStrings = {
   @RequiredStringValidator(
   fieldName = user.login,
   key = user.login.required,
   message = user.login.required)},
   ...
   )
   public String save() {
   System.out.println(SAVE);
   ...
  
   return SUCCESS;
   }
   }
  
  
  
 -
   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]






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

Re: Validator validWhen

2007-02-27 Thread Niall Pemberton

No its server-side only.

Niall

On 2/27/07, jmpdev [EMAIL PROTECTED] wrote:

Hi,

I would like to know if it is possible to call validWhen on the client
side?

I didn't find validWhen.js is it possible to find it somewhere?

Thanks,

Regards, Jean-Marie.


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



Re: [S2] Is it possible to get Struts' FilterDispatcher to serve up static files

2007-02-27 Thread mraible

I came up with a StaticFilter (from http://issues.appfuse.org/browse/APF-431)
that seems to work (see code below).  However, it causes another issue for
me. In my SiteMesh decorator, I'm including a messages.jsp that has calls to
the valueStack:

%-- ActionError Messages - usually set in Actions --%
s:if test=hasActionErrors()
div class=error id=errorMessages
  s:iterator value=actionErrors
 c:url value= 
alt=fmt:message key=icon.warning/ class=icon /
s:property escape=false/br /
  /s:iterator
   /div
/s:if

%-- FieldError Messages - usually set by validation rules --%
s:if test=hasFieldErrors()
div class=error id=errorMessages
  s:iterator value=fieldErrors
  s:iterator value=value
 c:url value= 
alt=fmt:message key=icon.warning/ class=icon /
 s:property escape=false/br /
  /s:iterator
  /s:iterator
   /div
/s:if

When I return a static page, this JSP causes issue:

java.lang.NullPointerException
at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)

This works fine when I request a Struts Action.  Is there any way to check
for the stack in my messages.jsp?

Thanks,

Matt

code
public class StaticFilter extends OncePerRequestFilter {
private final static String DEFAULT_INCLUDES = *.html;
private final static String DEFAULT_EXCLUDES = ;
private String[] excludes;
private String[] includes;
public static final String INCLUDES_PARAMETER = includes;
public static final String EXCLUDES_PARAMETER = excludes;

/**
 * Read the includes/excludes paramters and set the filter accordingly.
 */
public void initFilterBean() {
String includesParam =
getFilterConfig().getInitParameter(INCLUDES_PARAMETER);
if (StringUtils.isEmpty(includesParam)) {
includes = parsePatterns(DEFAULT_INCLUDES);
} else {
includes = parsePatterns(includesParam);
}

String excludesParam =
getFilterConfig().getInitParameter(EXCLUDES_PARAMETER);
if (StringUtils.isEmpty(excludesParam)) {
excludes = parsePatterns(DEFAULT_EXCLUDES);
} else {
excludes = parsePatterns(excludesParam);
}
}

private String[] parsePatterns(String delimitedPatterns) {
//make sure no patterns are repeated.
Set patternSet =
org.springframework.util.StringUtils.commaDelimitedListToSet(delimitedPatterns);
String[] patterns = new String[patternSet.size()];
int i = 0;
for (Iterator iterator = patternSet.iterator(); iterator.hasNext();
i++) {
//no trailing/leading white space.
String pattern = (String) iterator.next();
patterns[i] = pattern.trim();
}
return patterns;
}

public void doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
 FilterChain chain) throws IOException,
ServletException {

UrlPathHelper urlPathHelper = new UrlPathHelper();
String path = urlPathHelper.getPathWithinApplication(request);
boolean pathExcluded = PatternMatchUtils.simpleMatch(excludes,
path);
boolean pathIncluded = PatternMatchUtils.simpleMatch(includes,
path);

if (pathIncluded  !pathExcluded) {
RequestDispatcher rd =
getServletContext().getRequestDispatcher(path);
rd.forward(request, response);
}

chain.doFilter(request, response);
}
}
/code

Stuart Piltch wrote:
 
 mraible matt at raibledesigns.com writes:
 I'm using *.html as my default extension, which causes a whole host of
 issues
 with Dojo.  Regardless, I want to fight through it and see if I can come
 up
 with a solution.
 
 Hi Matt,
 
 I'm not sure about your specific FilterDispatcher question, but we also
 use
 *.html as a default extension. We ended up copying all the dojo html files
 that
 we use into out own /WEB-INF/widgets directory and adding an extra
 struts-dojo.xml file to our config:
 
 !DOCTYPE struts PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 2.0//EN
 http://struts.apache.org/dtds/struts-2.0.dtd;
 
 struts
 package name=dojo namespace=/struts/dojo/src/widget/templates
 extends=base
 action name=*
 result type=plainhtml/WEB-INF/widgets/{1}.html/result
 /action
 /package
 package name=dojoEditor2
 namespace=/struts/dojo/src/widget/templates/Editor2 extends=base
 action name=*
 result
 type=plainhtml/WEB-INF/widgets/Editor2/{1}.html/result
 /action
 /package
 package name=dojoEditor2Dialog
 namespace=/struts/dojo/src/widget/templates/Editor2/Dialog
 extends=base
 action name=*
 result
 type=plainhtml/WEB-INF/widgets/Editor2/Dialog/{1}.html/result
 /action
 /package
 /struts
 
 It seems convoluted, but it's working. The other dojo files (css, js, etc)
 are
 

logic:iterate is not compiling on Websphere6

2007-02-27 Thread Trasca Virgil
Hi all,

   I have this piece of struts html:logic code

logic:iterate id=addlInfoLabel name=registrationForm
property=addlInfoLabels indexId=i
   tr
   td class=smallbean:write
name=addlInfoLabel//td
   td
   html:text styleClass=textbox
size=30 maxlength=50
   property='
%=addlInfoValues[ + i.intValue() + ] %'
   /html:text
   /td
   /tr
 /logic:iterate

where
registrationForm is a struts form defined in struts-config.xml, and 2
array properties for my form
form-property
   name=addlInfoLabels
   type=java.lang.Object[]/
form-property
   name=addlInfoValues
   type=java.lang.Object[]/

When compiling on WS6 I get
!--
D([mb,br /[wsJspC] JSPG0091E: An error occurred at line: 110 in the file: 
/br /templates/selfreg/jsp/userRegiwbr /stration.jspbr / nbsp;[wsJspC] 
JSPG0093E: Generated servlet error from file: /templates/br 
/selfreg/jsp/userRegistrationwbr /.jspbr / nbsp;[wsJspC] 
D:/Partner_Portal_D1/bbwbr //prmonline/v75_0/distWebspherewbr //br 
/classes/jsp/templates/selfregwbr //jsp/_userRegistration.javawbr 
/:241:br /addlInfoLabel is already defined inbr 
/_jspService(javax.servlet.http.HttpServletwbr 
/Request,javax.servlet.http.HttpServletwbr /Response)br / nbsp;[wsJspC] 
nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; java.lang.Object 
addlInfoLabel \u003d null;br / nbsp;[wsJspC] nbsp; nbsp; nbsp; nbsp; 
nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; 
nbsp; nbsp;^br / nbsp;[wsJspC] 1 errorbr / nbsp;[wsJspC] ]br /br 
/Build and functionallity is working perfect on Weblogic. Please assistbr 
/me with this problem.br /br /Thank you,br //div,1]
);
D([mb,div style\u003d\direction:ltr\span class\u003dsgVirgilbr /br 
//span/div,0]
);
D([ce]);

//--
[wsJspC] JSPG0091E: An error occurred at line: 110 in the file: /
templates/selfreg/jsp/userRegistration.jsp
  [wsJspC] JSPG0093E: Generated servlet error from file: /templates/
selfreg/jsp/userRegistration.jsp
  [wsJspC] D:/Partner_Portal_D1/bb/prmonline/v75_0/distWebsphere/
classes/jsp/templates/selfreg/jsp/_userRegistration.java:241:
addlInfoLabel is already defined in
_jspService(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
  [wsJspC] java.lang.Object addlInfoLabel = null;
  [wsJspC]  ^
  [wsJspC] 1 error
  [wsJspC] ]

Build and functionallity is working perfect on Weblogic. Please assist
me with this problem.

Thank you,

Virgil


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



Fileupload in JBOSS AS

2007-02-27 Thread torben
I have problem to upload a file using strut2 in an jboss server, version 
4.0.5


In the jsp page I have:

   s:form action=FileUpload method=POST 
enctype=multipart/form-data
   s:file name=FileName value=Browse... size=50 
accept=application/vnd.ms-powerpoint/

s:textfield label=User Name name=username/
 s:submit value=Submit/
 /s:form

In the strut xml file I have:
   action name=FileUpload 
class=dk.frojonck.action.FileUploadAction
   result name=successindex.jsp/result  
   result name=errorwelcome.jsp/result  
   /action


In the FileUploadAction Class I have:

public class FileUploadAction extends ActionSupport {

   public String execute() throws Exception {
 MultiPartRequestWrapper multiWrapper = null;
 HttpServletRequest req=ServletActionContext.getRequest();
multiWrapper=(MultiPartRequestWrapper) req;

}

I get the Exception:

java.lang.ClassCastException: org.apache.catalina.connector.RequestFacade
dk.frojonck.action.FileUploadAction.execute(FileUploadAction.java:33)


Can someone give a hint, why I get an instance RequestFacade class 
instead of MultiPartRequestWrapper class.


As information I can also mention I am using Securityfilter 
(*http://securityfilter*.sourceforge.net/).


Best regards
Torben Frøberg


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



Need suggestion to load resource properties file dynamically

2007-02-27 Thread Prithivirajan Dhamodharan

Help required to load values in properties file(MessageResources) without
restarting/reloading the server.

Kindly give your suggestions.


RE: Load MessageResource from custom file path

2007-02-27 Thread Andrzej Bengner | e-direct Polska Sp. z o.o.
The ususal way to expose resource bundles for use with Struts1 is to include
the properties files in the webapp's classpath, configure them in
struts-config.xml and let Struts deal with loading them. Is there a reason
you need to store the files external to the webapp and load them manually?

Thanx.
I need to load file dynamically, because properties file must be located
outside /WEB-INF dir. Is there any way to obtain that?

Regards,
Andy


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



Issue with forwarding to another .do

2007-02-27 Thread Jay

Hi,
   I hope every one is fine. Iam forwarding a 'login.do' to another  path
like this

action path=/public/login type=blah blah 
forward name=success path=/public/defaultPage.do
/forward 

action path=/public/defaultPage
type=org.apache.struts.actions.ForwardAction
parameter=/jsp/framework/layout.jsp
/action


PROBLEM:   when i see the jsp file the url in address bar contain login.do
at the end, but i want defaultPage.do instead of login.do...  The lesson i
get from this is that struts does not consider the chain of .do in url, it
only shows first .do iin url. Please help me to modify this property of
struts.

thanks

-- 
View this message in context: 
http://www.nabble.com/Issue-with-forwarding-to-another-.do-tf3307243.html#a9199220
Sent from the Struts - User mailing list archive at Nabble.com.


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