Re[2]: Strange problem after upgrading from struts 1.1 to 1.3.8

2007-09-18 Thread Arne Brutschy
Hello,

P It is part of the HTML spec that disabled fields are not submitted in the
P request. This is not a Struts thing but HTML. You should make sure the HTML
P is being rendered the same, because that's probably what is causing your
P problem.
Hmm, I thought it might be like this. I'm just wondering why struts
1.1 is submitting the data. I don't know why my application is relying
on that, but it does (it's a bit old). Hmm, now I need to find a
work-around..

Is there a way to pass model attributes through the form without the
user seeing it (or having the possibility to alter them like the
hidden form fields)?

Thanks!
Arne

P On 9/17/07, Arne Brutschy [EMAIL PROTECTED] wrote:

 Hi,

 A I'm not sure if the reason for this is some change in the tags (my
 A tags are simply wrappers around the standard struts tags, ie.
 A XylonTextTag extends TextTag) or the changes in the request wrapper
 A system. I tried to set
 A controller
 A processorClass=org.apache.struts.action.RequestProcessor /
 A in the struts config as well, but no change.
 After debugging hours through tomcat code, I'm sure the Request
 processor is not the problem. At least, as soon as the request hits
 the action servlet, the postdata contains only the described
 parameters and not the ones the user couldn't write to.

 So I guess it's been some change in the tags or something else.. I
 will continue tomorrow...

 Arne


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




-- 
Arne BrutschyM ++49-170-7568918
Kantstr. 35  @ [EMAIL PROTECTED]
04275 Leipzig


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



Re: JAAS struts 2 Tutorial?

2007-09-18 Thread Mark McLaren
Hi all,

I think this is a generic problem rather than something Struts 2
specific.  Ideally in this situation you would want to be able to
access getRemoteUser() and isUserInRole() from the request.

One approach is to use your application servers' container managed
security, e.g. Tomcat JAASRealm.

Alternatively, the best way I can come up with is by extending
HttpServletRequestWrapper so that you can perform a
setUserPrincipal(), setRemoteUser() (etc.) and then wrapping the
request with your HttpServletRequestWrapper inside a ServletFilter.
Here is a VERY simple example that I wrote of such a filter which sets
up a user called test using this idea.

https://bmarks-portlet.svn.sourceforge.net/svnroot/bmarks-portlet/bmarks-portlet/trunk/src/main/java/uk/ac/bris/portlet/bookmarks/web/SimpleAuthFilter.java

However, since this relies on a ServletFilter you will require a
slightly different mechanism for portlets.

Mark

On 9/17/07, Eugen Stoianovici [EMAIL PROTECTED] wrote:
 I would like a tutorial on integrating jaas in struts2 too. Or rather
 than a tutorial, i would like to see some working code. I've done a lot
 of reading (i'm new to java web applications, it's been only a month
 since i've started) and i have some understanding on how this should
 work but i just can't picture it yet in a real app.

 I know I'm not being helpful here, sorry. But if anyone wants to write a
 tutorial on this, it would be greatly appreciated

 regards
 Eugen Stoianovici

 Muhammad Momin Rashid wrote:
  Hello Tom,
 
  Thanks for your continued input.  The application isn't simple, it is
  a J2EE application which will serve a large number of users (users
  will be using Web Browser or Mobile Device to access the application).
 
  Based on the help I got on this list, I have been successful in
  setting up JAAS and authenticating the user.
 
  Now I am just not sure if the user credentials are being kept.
  Following is the code I wrote which processes the user's login.  Can
  you see what I am missing?  I have placed the following code in the
  execute method of my action, perhaps it isn't the right place?
 
  Subject subject;
  Set principalList;
 
  String returnValue = SUCCESS;
  try
  {
  SecurityAssociationHandler handler = new
  SecurityAssociationHandler();
  SimplePrincipal user = new SimplePrincipal(username);
  handler.setSecurityInfo(user, password.toCharArray());
  LoginContext loginContext = new LoginContext(ContentPlatform,
  (CallbackHandler) handler);
  loginContext.login();
  subject = loginContext.getSubject();
  principalList = subject.getPrincipals();
  principalList.add(user);
 
  System.out.println(o0o0o subject:
  + subject);
  System.out.println(o0o0o principle:
  + principalList);
  }
  catch (LoginException e)
  {
  e.printStackTrace();
  returnValue = ERROR;
  }
 
  return returnValue;
 
 
  Regards,
  Muhammad Momin Rashid.
 
  tom tom wrote:
  If it's simple application, you dont need JAAS, You
  can do it via just session management isnt it? You
  might need user, role, user-role  threee tables on
  database thats it :)
 
  If you are using Application server like Jboss, the
  server itself got inbuilt features, which is
  altogether a different discussion.
 
 
  If the application is simple, do not make it
  complicated,
 
  we use JASS with CAS central authentication service
  which provided SSO features.
 
 
  hope this helps
 
 
 
 
 
 
 
 
 
  --- Muhammad Momin Rashid [EMAIL PROTECTED] wrote:
 
  Hello tom,
 
  I am building a J2EE application, that is going to
  be viewed using Web Browser and Mobile Devices.
 
  I am trying to implement security so that only a
  logged in user with the correct role can access the different parts
  of the
  application e.g. a non-logged in user can only access the public
  information, a logged in user can access his private data, and an
  logged in
  admin user can access the admin console.
 
  Regards,
  Muhammad Momin Rashid.
 
  tom tom wrote:
  what exactly you are trying to do?
 
 
  --- Muhammad Momin Rashid [EMAIL PROTECTED]
  wrote:
  Hello Everyone,
 
  I am looking for a tutorial for integrating JAAS
  into my Struts 2 + Hibernate Application.  Can anyone point me to
  the
  right resources?
 
  Is JAAS the best way to go, or there are better
  alternates?  If anyone thinks there are better alternates, can you
  provide
  me with the links to relevant tutorials?
 
  Regards,
  Muhammad Momin Rashid.
 
 
 
  -
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
 
 
 
 
 
  
 
  Luggage? GPS? Comic books? Check out fitting gifts for grads at
  Yahoo! Search
 
  http://search.yahoo.com/search?fr=oni_on_mailp=graduation+giftscs=bz
 
 
  

Re[2]: Strange problem after upgrading from struts 1.1 to 1.3.8

2007-09-18 Thread Arne Brutschy
Hi,

I just found out that the postdata didn't contain the attributes as
well when using struts 1.1. So nothing changed here. But when I get at
the beginning of the UserDispatchAction.update(), the dynaform has all
values filled in. So I'm wondering where struts fills in the data, and
why it doesn't do it anymore in 1.3.8

Arne

Paul Benedict wrote:
P It is part of the HTML spec that disabled fields are not submitted in the
P request. This is not a Struts thing but HTML. You should make sure the HTML
P is being rendered the same, because that's probably what is causing your
P problem.

P Paul

P On 9/17/07, Arne Brutschy [EMAIL PROTECTED] wrote:

 Hi,

 A I'm not sure if the reason for this is some change in the tags (my
 A tags are simply wrappers around the standard struts tags, ie.
 A XylonTextTag extends TextTag) or the changes in the request wrapper
 A system. I tried to set
 A controller
 A processorClass=org.apache.struts.action.RequestProcessor /
 A in the struts config as well, but no change.
 After debugging hours through tomcat code, I'm sure the Request
 processor is not the problem. At least, as soon as the request hits
 the action servlet, the postdata contains only the described
 parameters and not the ones the user couldn't write to.

 So I guess it's been some change in the tags or something else.. I
 will continue tomorrow...

 Arne


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




-- 
Arne BrutschyM ++49-170-7568918
Kantstr. 35  @ [EMAIL PROTECTED]
04275 Leipzig


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



Struts138 - Restrict Access to my actions?

2007-09-18 Thread Thomas.Zygadlewicz
Hi,
 
I want to restrict access to my actions - meaning: I dont want users to
be able to type them in the adressbar and jump around in my page as they
like to. 
It kinda makes my navigation effords senseless.
Ive try to write a servlet-filter which checks for actions beginning
with secure  - but It filters out every single of those actions -
regardless if I call it from one of my classes or directly from the
adress-bar
Id love another approach - or some corrections for my filter 
 
thanks guys
 
regards, Tom

 

 


Re: Struts138 - Restrict Access to my actions?

2007-09-18 Thread Balaji J

Hi Tom,

Interceptor is the best solution for this kind of problem.

Pass all your action requests to your custom interceptor that should
validate your requests and redirect to respective actions.

Regards,
Balaji


nomax wrote:
 
 Hi,
  
 I want to restrict access to my actions - meaning: I dont want users to
 be able to type them in the adressbar and jump around in my page as they
 like to. 
 It kinda makes my navigation effords senseless.
 Ive try to write a servlet-filter which checks for actions beginning
 with secure  - but It filters out every single of those actions -
 regardless if I call it from one of my classes or directly from the
 adress-bar
 Id love another approach - or some corrections for my filter 
  
 thanks guys
  
 regards, Tom
 
  
 
  
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts138---Restrict-Access-to-my-actions--tf4472422.html#a12752255
Sent from the Struts - User mailing list archive at Nabble.com.


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



AW: Struts138 - Restrict Access to my actions?

2007-09-18 Thread Thomas.Zygadlewicz
Hello Balaji,

Thanks for the quick response. The problem is: I dont have a clue what an 
interceptor is - and how to implement it in my 
Application. Do you have any examples or guides for this solution?

Thanks 

-Ursprüngliche Nachricht-
Von: Balaji J [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 18. September 2007 10:22
An: user@struts.apache.org
Betreff: Re: Struts138 - Restrict Access to my actions?


Hi Tom,

Interceptor is the best solution for this kind of problem.

Pass all your action requests to your custom interceptor that should
validate your requests and redirect to respective actions.

Regards,
Balaji


nomax wrote:
 
 Hi,
  
 I want to restrict access to my actions - meaning: I dont want users to
 be able to type them in the adressbar and jump around in my page as they
 like to. 
 It kinda makes my navigation effords senseless.
 Ive try to write a servlet-filter which checks for actions beginning
 with secure  - but It filters out every single of those actions -
 regardless if I call it from one of my classes or directly from the
 adress-bar
 Id love another approach - or some corrections for my filter 
  
 thanks guys
  
 regards, Tom
 
  
 
  
 
 

-- 
View this message in context: 
http://www.nabble.com/Struts138---Restrict-Access-to-my-actions--tf4472422.html#a12752255
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]



struts 1.3.5 problem

2007-09-18 Thread hariskumar

Hi All,

We are developing web application using struts 1.3.5 and oracle database.
When I requesting a process at the page in my web application. The process
going before getting result I am requesting another process in the same
page. On that time I got the following error.

Please any one know help me?

Sep 13, 2007 6:10:49 PM
org.apache.struts.chain.commands.AbstractExceptionHandler execute
WARNING: Unhandled exception
com.evermind.server.http.HttpIOException: An existing connection was
forcibly closed by the remote host.

at
com.evermind.server.http.EvermindServletOutputStream.write(EvermindServletOutputStream.java:203)
at
com.evermind.server.http.EvermindJSPWriter.writeOut(EvermindJSPWriter.java:495)
at
com.evermind.server.http.EvermindJSPWriter.jspflush(EvermindJSPWriter.java:391)
at
com.evermind.server.http.EvermindJSPWriter.flush(EvermindJSPWriter.java:367)
at
com.evermind.server.http.EvermindPageContext.include(EvermindPageContext.java:346)
at _search._courseReview._jspService(_courseReview.java:590)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)
at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:662)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:370)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at
com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:270)
at
com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:42)
at
com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:205)
at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
at
com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
at
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:99)
at
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:82)
at
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:51)
at
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:447)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at
oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
at
oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
at
oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)

Regards
K.Kalikumar

-- 
View this message in context: 
http://www.nabble.com/struts-1.3.5-problem-tf4472593.html#a12752452
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[3]: Strange problem after upgrading from struts 1.1 to 1.3.8

2007-09-18 Thread Arne Brutschy
Hi,

I'm just thinking aloud, so perhaps someone can drop-in and shed some
light here... :)

Post data send by browser is identical on both versions (old: struts
1.1 and new: struts 1.3.8). It contains only the displayed parameters,
nothing else. So in the old version, when the request arrives at
ActionServlet.process(), _all_ parameters and values of the
DynaActionform are in the HttpServletRequest included. In the new
version, there's a CoyoteRequest object, which hold only the submitted
parameters. I wonder what happens before the process() method? I
through the servlet container calls this directly? What method sets
the other parameter/value pairs in the request?

confused,
Arne

A I just found out that the postdata didn't contain the attributes as
A well when using struts 1.1. So nothing changed here. But when I get at
A the beginning of the UserDispatchAction.update(), the dynaform has all
A values filled in. So I'm wondering where struts fills in the data, and
A why it doesn't do it anymore in 1.3.8

A Arne

A Paul Benedict wrote:
P It is part of the HTML spec that disabled fields are not submitted in the
P request. This is not a Struts thing but HTML. You should make sure the HTML
P is being rendered the same, because that's probably what is causing your
P problem.

P Paul

P On 9/17/07, Arne Brutschy [EMAIL PROTECTED] wrote:

 Hi,

 A I'm not sure if the reason for this is some change in the tags (my
 A tags are simply wrappers around the standard struts tags, ie.
 A XylonTextTag extends TextTag) or the changes in the request wrapper
 A system. I tried to set
 A controller
 A processorClass=org.apache.struts.action.RequestProcessor /
 A in the struts config as well, but no change.
 After debugging hours through tomcat code, I'm sure the Request
 processor is not the problem. At least, as soon as the request hits
 the action servlet, the postdata contains only the described
 parameters and not the ones the user couldn't write to.

 So I guess it's been some change in the tags or something else.. I
 will continue tomorrow...

 Arne


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






-- 
Arne BrutschyM ++49-170-7568918
Kantstr. 35  @ [EMAIL PROTECTED]
04275 Leipzig


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



Re: S2 : Validation per Action method - ideas?

2007-09-18 Thread Ted Husted
I opened

 * https://issues.apache.org/struts/browse/WW-2191

for this, and noted the setting in the Validators documentation.

Thanks for pointing this out, Veronica!

-Ted.

On 8/10/07, Veronica Iturrioz [EMAIL PROTECTED] wrote:
 You must to set the property validateAnnotatedMethodOnly=true, and the 
 validation occurs only for the correct methods.

 interceptor-ref name=validation
 param name=validateAnnotatedMethodOnlytrue/param
 param name=excludeMethodsinput,back,cancel,browse/param
 /interceptor-ref

 but this is ok for server validation, not for client validation.
 Anybody know how to resolve that for client validations?


 Veronica.

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



Re: Conditional validation

2007-09-18 Thread Ted Husted
I added this as

 * http://jira.opensymphony.com/browse/XW-565

-Ted.

On 8/3/07, mraible [EMAIL PROTECTED] wrote:

 I figured out how to do this - posting here so others will benefit.

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



Re: Re[2]: Strange problem after upgrading from struts 1.1 to 1.3.8

2007-09-18 Thread Dave Newton
--- Arne Brutschy [EMAIL PROTECTED] wrote:
 But when I get at the beginning of the 
 UserDispatchAction.update(), the dynaform 
 has all values filled in.

With what?

Something in your application is pre-loading the
dynaform with reasonable values, no? I don't really
remember S1.1 at this point; do you have a filter,
request processor, action controller, etc. other than
the default?

d.


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



Re: Re[2]: Strange problem after upgrading from struts 1.1 to 1.3.8

2007-09-18 Thread Dave Newton
--- Arne Brutschy [EMAIL PROTECTED] wrote:
 But when I get at the beginning of the 
 UserDispatchAction.update(), the dynaform 
 has all values filled in.

With what?

Something in your application is pre-loading the
dynaform with reasonable values, no? I don't really
remember S1.1 at this point; do you have a filter,
request processor, action controller, etc. other than
the default?

d.


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



RE: S2 : Validation per Action method - ideas?

2007-09-18 Thread David Harland
Can someone please point me to the documentation that shows you how to
configure validation per action method using the validation xml files?
Or is this not possible?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Ted Husted
Sent: 18 September 2007 10:27
To: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Subject: Re: S2 : Validation per Action method - ideas?

I opened

 * https://issues.apache.org/struts/browse/WW-2191

for this, and noted the setting in the Validators documentation.

Thanks for pointing this out, Veronica!

-Ted.

On 8/10/07, Veronica Iturrioz [EMAIL PROTECTED] wrote:
 You must to set the property validateAnnotatedMethodOnly=true, and the
validation occurs only for the correct methods.

 interceptor-ref name=validation
 param name=validateAnnotatedMethodOnlytrue/param
 param name=excludeMethodsinput,back,cancel,browse/param
 /interceptor-ref

 but this is ok for server validation, not for client validation.
 Anybody know how to resolve that for client validations?


 Veronica.

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


- --
ML {UFI}

__
Ufi Limited 
Registered in England No.  3980770 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

learndirect Solutions Ltd 
Registered in England No. 5081669 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

UFI Charitable Trust 
Registered in England No.  3658378 
Registered Charity No.  1081028 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

This email has been scanned by the MessageLabs Email Security System.

__

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



Re[4]: Strange problem after upgrading from struts 1.1 to 1.3.8

2007-09-18 Thread Arne Brutschy
Hi,

D With what?
Well, that was what I was asking myself. :) Problem is, the app hasn't
been touched since 4 years. So I kind of re-engineering here.

D Something in your application is pre-loading the
D dynaform with reasonable values, no? I don't really
D remember S1.1 at this point; do you have a filter,
D request processor, action controller, etc. other than
D the default?
Yes, as it turns out, I'm using a request filter defined in the
web.xml for the actions. It looks up the actions, fetches the original
bean of the form, and checks for every submitted request parameter if
the user has access. If yes, it replaces the attribute with the new
values, if not, the change will be discarded.

I'm currently trying to find out why the request filter doesn't work
anymore. I thought this is not connected to the new request processor,
as it's defined in the web.xml outside of struts. And I'm using the
old request processor in the struts-config.xml:

controller processorClass=org.apache.struts.action.RequestProcessor /

The only change I made to the filter was replacing
public HttpServletRequest getRequest()
by
public ServletRequest getRequest()

Arne


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



Re: S2 : Validation per Action method - ideas?

2007-09-18 Thread Ted Husted
 * http://struts.apache.org/2.x/docs/validation.html

It's under Defining Validation Rules at 2. The term alias is used
to refer to the action method.

So if there's an actions.Register.java class with insert and
update action methods, then there might be XML docs like

/java/actions/Register-insert-validations.xml
/java/actions/Register-update-validations.xml

One would only file for the insert method and the other only for the
update method.

The framework makes the association automatically, based on the naming
convention, so there's nothing else to configure.

In WebWork in Action, it's at page 353-354, under Validation under
different contexts.

HTH, Ted
http://www.husted.com/ted/blog/


On 9/18/07, David Harland [EMAIL PROTECTED] wrote:
 Can someone please point me to the documentation that shows you how to
 configure validation per action method using the validation xml files?
 Or is this not possible?

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
 Ted Husted
 Sent: 18 September 2007 10:27
 To: Struts Users Mailing List
 Cc: [EMAIL PROTECTED]
 Subject: Re: S2 : Validation per Action method - ideas?

 I opened

  * https://issues.apache.org/struts/browse/WW-2191

 for this, and noted the setting in the Validators documentation.

 Thanks for pointing this out, Veronica!

 -Ted.

 On 8/10/07, Veronica Iturrioz [EMAIL PROTECTED] wrote:
  You must to set the property validateAnnotatedMethodOnly=true, and the
 validation occurs only for the correct methods.
 
  interceptor-ref name=validation
  param name=validateAnnotatedMethodOnlytrue/param
  param name=excludeMethodsinput,back,cancel,browse/param
  /interceptor-ref
 
  but this is ok for server validation, not for client validation.
  Anybody know how to resolve that for client validations?
 
 
  Veronica.

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



Struts2 Portlets slowing down liferay portal

2007-09-18 Thread Clark O'Brien
Hi,
I just downloaded struts2 a couple days ago and built
a basic portlet with it. When I added the portlet the
entire portal became dog slow. When I remove the
portlet it is performant again.

Can someone tell me why this would be happening. 
Also I don't want spring, caching,... I just want a
basic portlet. 

clark


   

Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

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



Validation in showcase examples

2007-09-18 Thread Dean Pullen
Not sure what your feelings are, but I've noticed the showcase
application example uses the commons validator for validation.

Would it make more sense for the validation (what little there is in
that app) to be changed to use the Xworks validator, considering this is
what the Struts 2 documentation gives a tutorial on?

(I did notice that the mailreader app used the Xworks validator so maybe
this is just a way of showing multiple validation framework
possibilities?)

Dean.

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



RE: S2 : Validation per Action method - ideas?

2007-09-18 Thread David Harland
Hi Ted,

It appears that if you use annotations you have more flexibilty than
with using xml. Would it not be possible to add the abililty to specify
validation files for each method without having to create aliases for
every single method. We have actions with quite a high number of methods
each wanting different validation. This can get messy. 


Regards

David 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Ted Husted
Sent: 18 September 2007 11:12
To: Struts Users Mailing List
Subject: Re: S2 : Validation per Action method - ideas?

 * http://struts.apache.org/2.x/docs/validation.html

It's under Defining Validation Rules at 2. The term alias is used to
refer to the action method.

So if there's an actions.Register.java class with insert and update
action methods, then there might be XML docs like

/java/actions/Register-insert-validations.xml
/java/actions/Register-update-validations.xml

One would only file for the insert method and the other only for the
update method.

The framework makes the association automatically, based on the naming
convention, so there's nothing else to configure.

In WebWork in Action, it's at page 353-354, under Validation under
different contexts.

HTH, Ted
http://www.husted.com/ted/blog/


On 9/18/07, David Harland [EMAIL PROTECTED] wrote:
 Can someone please point me to the documentation that shows you how to

 configure validation per action method using the validation xml files?
 Or is this not possible?

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of 
 Ted Husted
 Sent: 18 September 2007 10:27
 To: Struts Users Mailing List
 Cc: [EMAIL PROTECTED]
 Subject: Re: S2 : Validation per Action method - ideas?

 I opened

  * https://issues.apache.org/struts/browse/WW-2191

 for this, and noted the setting in the Validators documentation.

 Thanks for pointing this out, Veronica!

 -Ted.

 On 8/10/07, Veronica Iturrioz [EMAIL PROTECTED] wrote:
  You must to set the property validateAnnotatedMethodOnly=true, and 
  the
 validation occurs only for the correct methods.
 
  interceptor-ref name=validation
  param name=validateAnnotatedMethodOnlytrue/param
  param name=excludeMethodsinput,back,cancel,browse/param
  /interceptor-ref
 
  but this is ok for server validation, not for client validation.
  Anybody know how to resolve that for client validations?
 
 
  Veronica.

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


- --
ML {UFI}

__
Ufi Limited 
Registered in England No.  3980770 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

learndirect Solutions Ltd 
Registered in England No. 5081669 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

UFI Charitable Trust 
Registered in England No.  3658378 
Registered Charity No.  1081028 
Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 

This email has been scanned by the MessageLabs Email Security System.

__

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



Re: Struts2 Portlets slowing down liferay portal

2007-09-18 Thread Nils-Helge Garli
Hi!

Is it just the page the portlet is on? Have you tried switching of
devMode and logging? There  should be no extra performance hit
compared to a basic Struts 2 application, so the performance tuning
information in the documentation should apply:
http://struts.apache.org/2.x/docs/performance-tuning.html

And if you just need a basic portlet, just remove the things from the
configuration that you don't need, or start from scratch.

You can also try a snapshot of Struts 2.1 and see if that helps. The
portlet support in 2.1 and 2.0.10 should be greatly improved.

Nils-H

On 9/18/07, Clark O'Brien [EMAIL PROTECTED] wrote:
 Hi,
 I just downloaded struts2 a couple days ago and built
 a basic portlet with it. When I added the portlet the
 entire portal became dog slow. When I remove the
 portlet it is performant again.

 Can someone tell me why this would be happening.
 Also I don't want spring, caching,... I just want a
 basic portlet.

 clark



 
 Yahoo! oneSearch: Finally, mobile search
 that gives answers, not web links.
 http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

 -
 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: s:url/

2007-09-18 Thread stanlick
Thank you Balaji --

Do you think it could be a server setting?

Scott

On 9/17/07, Balaji J [EMAIL PROTECTED] wrote:


 Hi Scott,

 I verified s:url/ and even @s.url in both environments. I was not able
 to see the difference.
 In my desktop, i was using tomcat 5.5
 and my server has tomcat 6.0

 If you can explain me the difference, i can visualize where it went wrong
 or
 I am looking at something else.

 Thanks,
 Balaji


 stanlick wrote:
 
  I am discovering this tag does not render the same way between my
 desktop
  and ISP.
 
  My ISP is 2.4/2.0  Tomcat-5.5.23
  My desktop 2.5/2.1   Tomcat-6.0.14
 
  Everything works fine on my desktop but when I upload the war to my ISP,
  the
  url
 
  http://strutsschool.com//samples/samples.action
 
  is rendered as
 
  http://samples/samples.action
 
  Any clues?
 
  --
  Scott
  [EMAIL PROTECTED]
 
 

 --
 View this message in context:
 http://www.nabble.com/%3Cs%3Aurl-%3E-tf4470789.html#a12749748
 Sent from the Struts - User mailing list archive at Nabble.com.


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




-- 
Scott
[EMAIL PROTECTED]


Re: s:url/

2007-09-18 Thread Dave Newton
--- [EMAIL PROTECTED] wrote:
 Do you think it could be a server setting?

AFAIK the relevant code is in UrlHelper:

link.append(request.getServerName());

As a sanity check you could see what that returns in a
typical Action, but I'd guess something isn't right on
the server and it's returning a null or empty string
etc.

d.


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



Re: Struts2 Portlets slowing down liferay portal

2007-09-18 Thread Nils-Helge Garli
devMode: http://struts.apache.org/2.x/docs/devmode.html

See if you have log4j.jar other places in your classpath (server
scope/shared scope), and if you have log4j configuration files
somewhere else.

Nils-H

On 9/18/07, Clark O'Brien [EMAIL PROTECTED] wrote:
 Setting the freemarker_update_delay improved
 performance for sure.

 Hate to ask such a simple question but just own do I
 change the devMode option and logging - my log4j.xml
 has ERROR set for logging but I am getting INFO on the
 console.
Clark



 --- Nils-Helge Garli [EMAIL PROTECTED] wrote:

  Hi!
 
  Is it just the page the portlet is on? Have you
  tried switching of
  devMode and logging? There  should be no extra
  performance hit
  compared to a basic Struts 2 application, so the
  performance tuning
  information in the documentation should apply:
 
 http://struts.apache.org/2.x/docs/performance-tuning.html
 
  And if you just need a basic portlet, just remove
  the things from the
  configuration that you don't need, or start from
  scratch.
 
  You can also try a snapshot of Struts 2.1 and see if
  that helps. The
  portlet support in 2.1 and 2.0.10 should be greatly
  improved.
 
  Nils-H
 
  On 9/18/07, Clark O'Brien [EMAIL PROTECTED]
  wrote:
   Hi,
   I just downloaded struts2 a couple days ago and
  built
   a basic portlet with it. When I added the portlet
  the
   entire portal became dog slow. When I remove the
   portlet it is performant again.
  
   Can someone tell me why this would be happening.
   Also I don't want spring, caching,... I just want
  a
   basic portlet.
  
   clark
  
  
  
  
 
 
   Yahoo! oneSearch: Finally, mobile search
   that gives answers, not web links.
  
 
 http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
  
  
 
 -
   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]
 
 




 
 Building a website is a piece of cake. Yahoo! Small Business gives you all 
 the tools to get online.
 http://smallbusiness.yahoo.com/webhosting

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



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



Re: Struts2 Portlets slowing down liferay portal

2007-09-18 Thread Clark O'Brien
Setting the freemarker_update_delay improved
performance for sure.

Hate to ask such a simple question but just own do I
change the devMode option and logging - my log4j.xml
has ERROR set for logging but I am getting INFO on the
console.
   Clark



--- Nils-Helge Garli [EMAIL PROTECTED] wrote:

 Hi!
 
 Is it just the page the portlet is on? Have you
 tried switching of
 devMode and logging? There  should be no extra
 performance hit
 compared to a basic Struts 2 application, so the
 performance tuning
 information in the documentation should apply:

http://struts.apache.org/2.x/docs/performance-tuning.html
 
 And if you just need a basic portlet, just remove
 the things from the
 configuration that you don't need, or start from
 scratch.
 
 You can also try a snapshot of Struts 2.1 and see if
 that helps. The
 portlet support in 2.1 and 2.0.10 should be greatly
 improved.
 
 Nils-H
 
 On 9/18/07, Clark O'Brien [EMAIL PROTECTED]
 wrote:
  Hi,
  I just downloaded struts2 a couple days ago and
 built
  a basic portlet with it. When I added the portlet
 the
  entire portal became dog slow. When I remove the
  portlet it is performant again.
 
  Can someone tell me why this would be happening.
  Also I don't want spring, caching,... I just want
 a
  basic portlet.
 
  clark
 
 
 
 


  Yahoo! oneSearch: Finally, mobile search
  that gives answers, not web links.
 

http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
 
 

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



   

Building a website is a piece of cake. Yahoo! Small Business gives you all the 
tools to get online.
http://smallbusiness.yahoo.com/webhosting 

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



Re: s:url/

2007-09-18 Thread stanlick
Great!  Getting the ISP to do anything outside of accept my money is like
getting through the airport with a duffle bag.

This code works running on the server

%
String path = request.getContextPath();
String basePath = request.getScheme
()+://+request.getServerName()+:+request.getServerPort()+path+/;
%

So perhaps the UrlHelper could fall back on it?

Scott

On 9/18/07, Dave Newton [EMAIL PROTECTED] wrote:

 --- [EMAIL PROTECTED] wrote:
  Do you think it could be a server setting?

 AFAIK the relevant code is in UrlHelper:

 link.append(request.getServerName());

 As a sanity check you could see what that returns in a
 typical Action, but I'd guess something isn't right on
 the server and it's returning a null or empty string
 etc.

 d.


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




-- 
Scott
[EMAIL PROTECTED]


Re: s:url/

2007-09-18 Thread Dave Newton
--- [EMAIL PROTECTED] wrote:
 This code works running on the server
 
 %
 String path = request.getContextPath();
 String basePath = request.getScheme()
+ :// + request.getServerName() ...

Oh, on the remote server? Hmm, I would have expected
that to fail in the same way--I assumed the
HttpServletRequest seen by UrlHelper would be the same
as the one in a JSP.

Now I'm just [more] confused [than normal].

d.


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



Re: Avoiding OGNL, or getting fancier with it.

2007-09-18 Thread Dave Newton
--- Vinny [EMAIL PROTECTED] wrote:
 myBean[0].propertyName for example
 of values that struts 1.x was able to pick back up
 in the action. I'm sure there must be a way to do 
 this in S2, right?

The same way, although AFAIK you have to build the
property name by hand using the iterator's named
status variable.

d.


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



Re: Avoiding OGNL, or getting fancier with it.

2007-09-18 Thread Vinny
I will give this a try as well. I have been wrestling with getting my
indexed values
back from my jsp's forms. In struts 1.1+ , this was handled well by using
nested
tags. Nested used to produced arrays (  myBean[0].propertyName for example)

of values that struts 1.x was able to pick back up in the action. I'm sure
there must
be a way to do this in S2, right?

On 9/14/07, Laurie Harper [EMAIL PROTECTED] wrote:

 Lally Singh wrote:
  Hey all, I've got a 2-layer hierarchy of data to put in through a
  form, and it's getting messy.  I've got a set of groups, each with a
  set of questions within.  Each are indexed with simple integers.
 
  Ive been using
 
  input type=radio name=s:property value='group' /_s:property
  value='question' / value=1 /
 
  And wanted to pull the values out of the request, but suddenly I've
  got this bad boy:
  ParametersInterceptor - [setParameters]: Unexpected Exception catched:
  Error setting expression '0_0' with value '[Ljava.lang.String;@a572fc'

 That should go away if you set devMode to false. Just ignore it.

  How do I get ParametersInterceptor to leave it alone, or put in the
  mechanics to let OGNL set the property correctly?  My groups are an
  ArrayListResponseGroup, each with a member responses, which is an
  ArrayListResponse.

 Maybe something like this (untested):

s:iterator var='group' value='groupList' status='gs'
  s:iterator var='question' value='#group.questionList' status='qs'
s:textfield name='%{#groupList[#gs.index]
.questionList[#qs.index]}'/

 (without the linebreak in the QGNL expression).

 L.


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




-- 
The Street Programmer http://streetprogrammer.com


Inconsistent behavior in value tag attribute

2007-09-18 Thread Shepherd, Darren S
Is there some logical reason why the behavior of the value tag attribute
seems to be different among different tags.  Basically, what I observe
is that if I'm using altSyntax, depending on the tag, the %{} syntax is
required or optional in the value attributes.  For example, the below
tag:

 

s:url ... 

s:param name=name value=%{a} /

/s:url

 

Is exactly the same as:

 

s:url ... 

s:param name=name value=a /

/s:url

 

But the following two tags are not the same:

 

s:form ...

s:hidden name=name value=%{a} /

/s:form

 

s:form ...

s:hidden name=name value=a /

/s:form

 

I have traced this down to the difference in the two methods
Component.findValue(String) and Component.findValue(String,Class).  It
seems some tags use findValue(String) to parse the value attribute and
some use findValue(String,Class).  This, of course, make sense because
some tags expect the value attribute to evaluate to a String or an
object.  The problem is that the expression for the two methods is
handled slightly differently.

 

findValue(String) : the %{} enclosing syntax is optional, but the
following expression will fail %{a}%{b}

findValue(String,String.class): the %{} syntax is required for
evaluation and the following expression is valid %{a}%{b}

 

I realize if you are evaluating to an Object the %{a}%{b} makes no sense
at all.  The problem seams to me that some tags are evaluating to a
Object when in fact it should be a String, so the tag should use
findValue(String,String.class) as opposed to findValue(String).  I think
at this point, I've confused even myself.  Basically is comes down to
this, logically it seems that if I can do:

 

s:form ... 

s:hidden name=name value=%{a}%{b} /

/s:form

 

I should be able to do:

 

s:url ... 

s:param name=name value=%{a}%{b} /

/s:url

 

Darren



Logon_* and precise rules for action mapping

2007-09-18 Thread John Lindsay Orr
I am exploring Struts2 and I have what may be a very simple question 
from the Tutorial at http://struts.apache.org/2.x/docs/bootstrap.html.


In the tutorial one sets the struts.xml to include the mapping

 action name=Logon_* method={1} class=tutorial.Logon

Now, I understand why this works in response to the request 
Logon_input.action, but I can't see why it continues to match with the 
plain Login.action request, which is what the form in the Login.jsp file 
sends.


I've looked pretty widely through the Struts2 site and also experimented 
with this code and I can see that it works and that the idiom is also 
expected to work in this way in other examples. However the stated 
explanation of the wildcard character matches with 0 or more 
characters does not seem to show why Logon would match with Logon_*.


Thanks,

John

--
Professor of Mathematics
University of Nebraska - Lincoln
http://www.math.unl.edu/~jorr


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



RE: S2 : Validation per Action method - ideas?

2007-09-18 Thread cilquirm

I'm not sure I follow how validation is more flexible when using annotations
vs. xml files.

Aliases are how you tell xwork that this method is the one to be executed,
so there's a 1-to-1 mapping between aliases and methods.

File based validation is, in a sense, more flexible, because you can define
multiple aliases against a single method and specify different rules for
each of those.

If you could provide more information regarding your situation, that would
be of great insight.

Thanks,
-a



David Harland-3 wrote:
 
 Hi Ted,
 
 It appears that if you use annotations you have more flexibilty than
 with using xml. Would it not be possible to add the abililty to specify
 validation files for each method without having to create aliases for
 every single method. We have actions with quite a high number of methods
 each wanting different validation. This can get messy. 
 
 
 Regards
 
 David 
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
 Ted Husted
 Sent: 18 September 2007 11:12
 To: Struts Users Mailing List
 Subject: Re: S2 : Validation per Action method - ideas?
 
  * http://struts.apache.org/2.x/docs/validation.html
 
 It's under Defining Validation Rules at 2. The term alias is used to
 refer to the action method.
 
 So if there's an actions.Register.java class with insert and update
 action methods, then there might be XML docs like
 
 /java/actions/Register-insert-validations.xml
 /java/actions/Register-update-validations.xml
 
 One would only file for the insert method and the other only for the
 update method.
 
 The framework makes the association automatically, based on the naming
 convention, so there's nothing else to configure.
 
 In WebWork in Action, it's at page 353-354, under Validation under
 different contexts.
 
 HTH, Ted
 http://www.husted.com/ted/blog/
 
 
 On 9/18/07, David Harland [EMAIL PROTECTED] wrote:
 Can someone please point me to the documentation that shows you how to
 
 configure validation per action method using the validation xml files?
 Or is this not possible?

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of 
 Ted Husted
 Sent: 18 September 2007 10:27
 To: Struts Users Mailing List
 Cc: [EMAIL PROTECTED]
 Subject: Re: S2 : Validation per Action method - ideas?

 I opened

  * https://issues.apache.org/struts/browse/WW-2191

 for this, and noted the setting in the Validators documentation.

 Thanks for pointing this out, Veronica!

 -Ted.

 On 8/10/07, Veronica Iturrioz [EMAIL PROTECTED] wrote:
  You must to set the property validateAnnotatedMethodOnly=true, and 
  the
 validation occurs only for the correct methods.
 
  interceptor-ref name=validation
  true
  input,back,cancel,browse
  /interceptor-ref
 
  but this is ok for server validation, not for client validation.
  Anybody know how to resolve that for client validations?
 
 
  Veronica.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 - --
 ML {UFI}
 
 __
 Ufi Limited 
 Registered in England No.  3980770 
 Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 
 
 learndirect Solutions Ltd 
 Registered in England No. 5081669 
 Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 
 
 UFI Charitable Trust 
 Registered in England No.  3658378 
 Registered Charity No.  1081028 
 Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP 
 
 This email has been scanned by the MessageLabs Email Security System.
 
 __
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/S2-%3A-Validation-per-Action-method---ideas--tf4242670.html#a12758403
Sent from the Struts - User mailing list archive at Nabble.com.


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



How to accomplish Html:link in struts 2

2007-09-18 Thread Xibin Liu

What is the equivalent tag in struts 2.0 for the following struts 1 tag?

html:link forward=helpbean:message bundle=message
key=help//html:link

I know s:text will replace bean:message, but what about html:link ?


Thanks


RE: S2 : Validation per Action method - ideas?

2007-09-18 Thread David Harland
s:form
s:submit key=buy.key method=buy/
s:submit key=sell.key method=sell/ /s:form


action name=auction class=my.AuctionAction
result/auction.jsp/result
/action


public class AuctionAction {
public String buy() {
return SUCCESS;
}

public String sell() {
return SUCCESS;
}
}

Consider this code. It would be preferable to be able to write a
separate validation xml for each of the above methods. E.g.

AuctionAction-sell-validation.xml
AuctionAction-buy-validation.xml

Presently Struts 2 seems to ignore the method name if it is
non-annotated action. Are we missing something here? It seems the only
way to get this to work would be to change the jsp and struts xml as
follows:

s:form
s:submit key=buy.key action=auctionbuy method=buy/
s:submit key=sell.key action=auctionsell method=sell/
/s:form

action name=auction* class=my.AuctionAction
result/auction.jsp/result
/action

With validation named as follows:

AuctionAction-auctionsell-validation.xml
AuctionAction-auctionbuy-validation.xml

This has a downside that we have to hardcode the action alias in the JSP
which limits the reuse of a JSP that maybe used by more than one action.


-Original Message-
From: cilquirm [mailto:[EMAIL PROTECTED] 
Sent: 18 September 2007 15:41
To: user@struts.apache.org
Subject: RE: S2 : Validation per Action method - ideas?


I'm not sure I follow how validation is more flexible when using
annotations vs. xml files.

Aliases are how you tell xwork that this method is the one to be
executed, so there's a 1-to-1 mapping between aliases and methods.

File based validation is, in a sense, more flexible, because you can
define multiple aliases against a single method and specify different
rules for each of those.

If you could provide more information regarding your situation, that
would be of great insight.

Thanks,
-a



David Harland-3 wrote:
 
 Hi Ted,
 
 It appears that if you use annotations you have more flexibilty than 
 with using xml. Would it not be possible to add the abililty to 
 specify validation files for each method without having to create 
 aliases for every single method. We have actions with quite a high 
 number of methods each wanting different validation. This can get
messy.
 
 
 Regards
 
 David
 
 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of 
 Ted Husted
 Sent: 18 September 2007 11:12
 To: Struts Users Mailing List
 Subject: Re: S2 : Validation per Action method - ideas?
 
  * http://struts.apache.org/2.x/docs/validation.html
 
 It's under Defining Validation Rules at 2. The term alias is used 
 to refer to the action method.
 
 So if there's an actions.Register.java class with insert and
update
 action methods, then there might be XML docs like
 
 /java/actions/Register-insert-validations.xml
 /java/actions/Register-update-validations.xml
 
 One would only file for the insert method and the other only for the 
 update method.
 
 The framework makes the association automatically, based on the naming

 convention, so there's nothing else to configure.
 
 In WebWork in Action, it's at page 353-354, under Validation under 
 different contexts.
 
 HTH, Ted
 http://www.husted.com/ted/blog/
 
 
 On 9/18/07, David Harland [EMAIL PROTECTED] wrote:
 Can someone please point me to the documentation that shows you how 
 to
 
 configure validation per action method using the validation xml
files?
 Or is this not possible?

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

 Ted Husted
 Sent: 18 September 2007 10:27
 To: Struts Users Mailing List
 Cc: [EMAIL PROTECTED]
 Subject: Re: S2 : Validation per Action method - ideas?

 I opened

  * https://issues.apache.org/struts/browse/WW-2191

 for this, and noted the setting in the Validators documentation.

 Thanks for pointing this out, Veronica!

 -Ted.

 On 8/10/07, Veronica Iturrioz [EMAIL PROTECTED] wrote:
  You must to set the property validateAnnotatedMethodOnly=true, and 
  the
 validation occurs only for the correct methods.
 
  interceptor-ref name=validation
  true
  input,back,cancel,browse
  /interceptor-ref
 
  but this is ok for server validation, not for client validation.
  Anybody know how to resolve that for client validations?
 
 
  Veronica.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 - --
 ML {UFI}
 
 __
 Ufi Limited
 Registered in England No.  3980770
 Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP
 
 learndirect Solutions Ltd
 Registered in England No. 5081669
 Registered Office:  Dearing House, 1 Young Street, Sheffield, S1 4UP
 
 UFI Charitable Trust
 Registered in England No.  3658378
 Registered Charity No.  1081028

Re[5]: Strange problem after upgrading from struts 1.1 to 1.3.8 (RequestWrappers not working anymore?)

2007-09-18 Thread Arne Brutschy
Hi,

I used to filter the request parameters of certain actions. It works
like this: the original bean is stored in the session. When the user
hits update, the filter replaces the paramters submitted by the user
with the original ones. Then, it replaces or deletes the values the
user has changed and has access to. In that way I always end up with a
valid bean...

I'm using a requestwrapper, as the parameter map of the original request
isn't writable. My problem is now that as soon as the wrapper is used
to encapsulate the request, the action mapping isn't working anymore.
So after the user hits update, he returns to the start page (but he
should be redirected to the UserDispatchAction).

I thought about reimplementing my filters as chain commands, but that
would be alot of trouble... And it doesn't help with the non-writeable
parameter map.

Any ideas why the request wrappers aren't working anymore?

Arne


Struts Users Mailing List wrote:
D Something in your application is pre-loading the
D dynaform with reasonable values, no? I don't really
D remember S1.1 at this point; do you have a filter,
D request processor, action controller, etc. other than
D the default?
A Yes, as it turns out, I'm using a request filter defined in the
A web.xml for the actions. It looks up the actions, fetches the original
A bean of the form, and checks for every submitted request parameter if
A the user has access. If yes, it replaces the attribute with the new
A values, if not, the change will be discarded.

A I'm currently trying to find out why the request filter doesn't work
A anymore. I thought this is not connected to the new request processor,
A as it's defined in the web.xml outside of struts. And I'm using the
A old request processor in the struts-config.xml:

A controller
A processorClass=org.apache.struts.action.RequestProcessor /

A The only change I made to the filter was replacing
A public HttpServletRequest getRequest()
A by
A public ServletRequest getRequest()



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



Re: How to accomplish Html:link in struts 2

2007-09-18 Thread Kun Niu
s:url and s:a
?

2007/9/18, Xibin Liu [EMAIL PROTECTED]:

 What is the equivalent tag in struts 2.0 for the following struts 1 tag?

 html:link forward=helpbean:message bundle=message
 key=help//html:link

 I know s:text will replace bean:message, but what about html:link ?


 Thanks



-- 
失业
 牛坤
MSN:[EMAIL PROTECTED]


RE: How to accomplish Html:link in struts 2

2007-09-18 Thread Xibin Liu
 
I mean implementing the forward in the html:link tag too.
It would be nice if you can give me an example for that.

Thanks


-Original Message-
From: Kun Niu [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 18, 2007 11:33 AM
To: Struts Users Mailing List
Subject: Re: How to accomplish Html:link in struts 2

s:url and s:a
?

2007/9/18, Xibin Liu [EMAIL PROTECTED]:

 What is the equivalent tag in struts 2.0 for the following struts 1 tag?

 html:link forward=helpbean:message bundle=message
 key=help//html:link

 I know s:text will replace bean:message, but what about html:link ?


 Thanks



--
失业
 牛坤
MSN:[EMAIL PROTECTED]

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



RE: How to accomplish Html:link in struts 2

2007-09-18 Thread Dave Newton
--- Xibin Liu [EMAIL PROTECTED] wrote:
 I mean implementing the forward in the html:link tag
 too. It would be nice if you can give me an example 
 for that.

Still s:url action=.../

There are no ActionForwards in S2.

d.


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



Re: JAAS struts 2 Tutorial?

2007-09-18 Thread Chris Pratt
On 9/18/07, Ian Roughley [EMAIL PROTECTED] wrote:
 By implementing the PrincipalAware interface, the Principal object will
 be injected into the action with those values from the request (the
 user, roles, etc.).  The values can be be used in the action, or the
 Principal can be exposed with a setter for the actions to use.

But if you don't use Container Managed Authentication, how do you get
the Principal into the request so that PrincipalAware can inject it,
without using a ServletFilter?
  (*Chris*)

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



Re: JAAS struts 2 Tutorial?

2007-09-18 Thread Ian Roughley
By implementing the PrincipalAware interface, the Principal object will 
be injected into the action with those values from the request (the 
user, roles, etc.).  The values can be be used in the action, or the 
Principal can be exposed with a setter for the actions to use.


/Ian

Mark McLaren wrote:

Hi all,

I think this is a generic problem rather than something Struts 2
specific.  Ideally in this situation you would want to be able to
access getRemoteUser() and isUserInRole() from the request.

One approach is to use your application servers' container managed
security, e.g. Tomcat JAASRealm.

Alternatively, the best way I can come up with is by extending
HttpServletRequestWrapper so that you can perform a
setUserPrincipal(), setRemoteUser() (etc.) and then wrapping the
request with your HttpServletRequestWrapper inside a ServletFilter.
Here is a VERY simple example that I wrote of such a filter which sets
up a user called test using this idea.

https://bmarks-portlet.svn.sourceforge.net/svnroot/bmarks-portlet/bmarks-portlet/trunk/src/main/java/uk/ac/bris/portlet/bookmarks/web/SimpleAuthFilter.java

However, since this relies on a ServletFilter you will require a
slightly different mechanism for portlets.

Mark

On 9/17/07, Eugen Stoianovici [EMAIL PROTECTED] wrote:
  

I would like a tutorial on integrating jaas in struts2 too. Or rather
than a tutorial, i would like to see some working code. I've done a lot
of reading (i'm new to java web applications, it's been only a month
since i've started) and i have some understanding on how this should
work but i just can't picture it yet in a real app.

I know I'm not being helpful here, sorry. But if anyone wants to write a
tutorial on this, it would be greatly appreciated

regards
Eugen Stoianovici

Muhammad Momin Rashid wrote:


Hello Tom,

Thanks for your continued input.  The application isn't simple, it is
a J2EE application which will serve a large number of users (users
will be using Web Browser or Mobile Device to access the application).

Based on the help I got on this list, I have been successful in
setting up JAAS and authenticating the user.

Now I am just not sure if the user credentials are being kept.
Following is the code I wrote which processes the user's login.  Can
you see what I am missing?  I have placed the following code in the
execute method of my action, perhaps it isn't the right place?

Subject subject;
Set principalList;

String returnValue = SUCCESS;
try
{
SecurityAssociationHandler handler = new
SecurityAssociationHandler();
SimplePrincipal user = new SimplePrincipal(username);
handler.setSecurityInfo(user, password.toCharArray());
LoginContext loginContext = new LoginContext(ContentPlatform,
(CallbackHandler) handler);
loginContext.login();
subject = loginContext.getSubject();
principalList = subject.getPrincipals();
principalList.add(user);

System.out.println(o0o0o subject:
+ subject);
System.out.println(o0o0o principle:
+ principalList);
}
catch (LoginException e)
{
e.printStackTrace();
returnValue = ERROR;
}

return returnValue;


Regards,
Muhammad Momin Rashid.

tom tom wrote:
  

If it's simple application, you dont need JAAS, You
can do it via just session management isnt it? You
might need user, role, user-role  threee tables on
database thats it :)

If you are using Application server like Jboss, the
server itself got inbuilt features, which is
altogether a different discussion.


If the application is simple, do not make it
complicated,

we use JASS with CAS central authentication service
which provided SSO features.


hope this helps









--- Muhammad Momin Rashid [EMAIL PROTECTED] wrote:



Hello tom,

I am building a J2EE application, that is going to
be viewed using Web Browser and Mobile Devices.

I am trying to implement security so that only a
logged in user with the correct role can access the different parts
of the
application e.g. a non-logged in user can only access the public
information, a logged in user can access his private data, and an
logged in
admin user can access the admin console.

Regards,
Muhammad Momin Rashid.

tom tom wrote:
  

what exactly you are trying to do?


--- Muhammad Momin Rashid [EMAIL PROTECTED]


wrote:
  

Hello Everyone,

I am looking for a tutorial for integrating JAAS
into my Struts 2 + Hibernate Application.  Can anyone point me to
  

the
  

right resources?

Is JAAS the best way to go, or there are better
alternates?  If anyone thinks there are better alternates, can you
  

provide
  

me with the links to relevant tutorials?

Regards,
Muhammad Momin Rashid.



  

-


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


  





Re: S2 : Validation per Action method - ideas?

2007-09-18 Thread Ted Husted
With some work, the annotations could be as flexible as the XML
validations. The messy problem in either case is being able to express
when and when-not to inherit validations from parent classes.

Right now, you can shut off the inheritance of validations (as
Veronica described), but it shuts off all inheritance, even property
validations on parent classes. In turn, this is awkward since it can
be convenient to have one place to declare the format of a field (e.g.
email) whenever it is used.

In my own work, I'm getting away from aliases and tending to use more
classes. Where I might have used a class with multiple method before,
I've added a package with multiple classes. For now, this paradigm
seems to work better with the existing validation annotations.

Add in the ActionNames and ActionName annotations frrom the SmartURLs
plugin, and it becomes possible to write non-trivial Struts 2
applications using only conventions and annotations (connotations?) :)

It doesn't use multiple packages, but I have just finished a draft of
a Zero Configuration MailReader. There isn't any kind of a
distribution yet, but it can be obtained from SVN:

 * http://sq1-struts2.googlecode.com/svn/trunk/articles/mailreader-zero/

All the JARs are checked in, and it shouldn't be hard to import the
project into any given IDE.

Of course, there are many people who prefer to use multiple methods. I
expect that the annotations could be extended to better support action
aliases, but we need more volunteers to do the work.

HTH, Ted
http://www.husted.com/ted/blog/


On 9/18/07, David Harland [EMAIL PROTECTED] wrote:
 Hi Ted,

 It appears that if you use annotations you have more flexibilty than
 with using xml. Would it not be possible to add the abililty to specify
 validation files for each method without having to create aliases for
 every single method. We have actions with quite a high number of methods
 each wanting different validation. This can get messy.


 Regards

 David

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



s:include tag

2007-09-18 Thread Sairam01

I'm unable to include a jsp dynamically. The include tag doesn't evaluate
VALUE of the expression.

s:include value=%{someName}.jsp/

someName is a attribute on my action code. Should this work..? 
-- 
View this message in context: 
http://www.nabble.com/s%3Ainclude-tag-tf4476115.html#a12763052
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: s:include tag

2007-09-18 Thread Piero Sartini
Am Dienstag, 18. September 2007 20:22:41 schrieb Sairam01:
 I'm unable to include a jsp dynamically. The include tag doesn't evaluate
 VALUE of the expression.

 s:include value=%{someName}.jsp/

 someName is a attribute on my action code. Should this work..?

s:include value=%{someName}.jsp/

is this a typo in the email? it should read
s:include value=%{someName}.jsp/

if there is a proper getSomeName() method in your action, this should work.. 

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



Struts 2 tutorial

2007-09-18 Thread Slattery, Tim - BLS
I'm trying to follow along the Struts 2 tutorial. The HelloWorld.java
file starts this way:

   package tutorial; 
   import com.opensymphony.xwork2.ActionSupport; 
   public class HelloWorld extends ActionSupport { 

What's with com.opensymphony.xwork2.ActionSupport? I don't see anything
like that in the Struts 2.0.9 package I downloaded. Did I miss
something?

--
Tim Slattery
[EMAIL PROTECTED]


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



RE: Struts 2 tutorial

2007-09-18 Thread Wesley Wannemacher
It is in the xwork jar file. It comes with any of the struts apps
(struts2-blank, struts2-showcase). Struts2 is heavily based on WebWork,
which uses xwork. I am not sure if this will be re-factored out. 

-Wes 

-Original Message-
From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 18, 2007 2:22 PM
To: Struts Users Mailing List
Subject: Struts 2 tutorial

I'm trying to follow along the Struts 2 tutorial. The HelloWorld.java
file starts this way:

   package tutorial; 
   import com.opensymphony.xwork2.ActionSupport; 
   public class HelloWorld extends ActionSupport { 

What's with com.opensymphony.xwork2.ActionSupport? I don't see anything
like that in the Struts 2.0.9 package I downloaded. Did I miss
something?

--
Tim Slattery
[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: struts 1.3.5 problem

2007-09-18 Thread Laurie Harper
It's not clear what you're doing to cause the exception; what does 
'request a process' mean?


L.

hariskumar wrote:

Hi All,

We are developing web application using struts 1.3.5 and oracle database.
When I requesting a process at the page in my web application. The process
going before getting result I am requesting another process in the same
page. On that time I got the following error.

Please any one know help me?

Sep 13, 2007 6:10:49 PM
org.apache.struts.chain.commands.AbstractExceptionHandler execute
WARNING: Unhandled exception
com.evermind.server.http.HttpIOException: An existing connection was
forcibly closed by the remote host.

at
com.evermind.server.http.EvermindServletOutputStream.write(EvermindServletOutputStream.java:203)
at
com.evermind.server.http.EvermindJSPWriter.writeOut(EvermindJSPWriter.java:495)
at
com.evermind.server.http.EvermindJSPWriter.jspflush(EvermindJSPWriter.java:391)
at
com.evermind.server.http.EvermindJSPWriter.flush(EvermindJSPWriter.java:367)
at
com.evermind.server.http.EvermindPageContext.include(EvermindPageContext.java:346)
at _search._courseReview._jspService(_courseReview.java:590)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)
at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:662)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:370)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at
com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:270)
at
com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:42)
at
com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:205)
at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
at
com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
at
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:99)
at
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:82)
at
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:51)
at
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:48)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:280)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1858)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:447)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at
oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
at
oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
at
oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)

Regards
K.Kalikumar




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



Re: Avoiding OGNL, or getting fancier with it.

2007-09-18 Thread Vinny
Very cool. I was able to get mine working with:


Action Class :



 ListMyBean beanList;
.getter/setter


in the jsp:


s:form action=/myaction

.

  s:iterator value=beanList  id=beantList status=stat  


  s:hiddenname=beanList[%{#stat.index}].beanID  value=%{beanID}  /

!-- yeah, good ol' LabelValueBeans can still be used , just remember to use
listKey=value listValue=label  --

  s:select name = beanList[%{#stat.index}].beanStatus  list=LVBList
listKey=value listValue=label  value=%{beanStatus}/

/s:iterator
...
/s:form


on submit I access my List of beans with


List mysubmittedList  = getBeantList() ;







On 9/18/07, Dave Newton [EMAIL PROTECTED] wrote:

 --- Vinny [EMAIL PROTECTED] wrote:
  myBean[0].propertyName for example
  of values that struts 1.x was able to pick back up
  in the action. I'm sure there must be a way to do
  this in S2, right?

 The same way, although AFAIK you have to build the
 property name by hand using the iterator's named
 status variable.

 d.


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




-- 
The Street Programmer http://streetprogrammer.com


More tutorial questions

2007-09-18 Thread Slattery, Tim - BLS
 What's with com.opensymphony.xwork2.ActionSupport? 
 I don't see anything like that in the Struts 2.0.9 package 
 I downloaded. Did I miss something?

OK, I found that in the xwork-2.0.4.jar library, not in the struts2-core
library, where I expected it.

Now I get this message when I try to compile HelloWorld:

quote
Cannot access class com.opensymphony.xwork2.ActionSupport; class file
has wrong version 49.0, should be 45.3 or 46.0 or 48.0.
/quote

Now what's going on?




--
Tim Slattery
[EMAIL PROTECTED]



Re: More tutorial questions

2007-09-18 Thread Jim Cushing

That class was built for JDK 1.5/Java 5, and you're running JDK 1.4.

Is running Java 5 an option for you? If not, you might be able to re- 
compile XWork for 1.4.


On Sep 18, 2007, at 2:50 PM, Slattery, Tim - BLS wrote:


What's with com.opensymphony.xwork2.ActionSupport?
I don't see anything like that in the Struts 2.0.9 package
I downloaded. Did I miss something?


OK, I found that in the xwork-2.0.4.jar library, not in the struts2- 
core

library, where I expected it.

Now I get this message when I try to compile HelloWorld:

quote
Cannot access class com.opensymphony.xwork2.ActionSupport; class file
has wrong version 49.0, should be 45.3 or 46.0 or 48.0.
/quote

Now what's going on?




--
Tim Slattery
[EMAIL PROTECTED]




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



Re: JAAS struts 2 Tutorial?

2007-09-18 Thread Ian Roughley
If you are not using container managed persistence, where the 
HttpRequest values are being set in the environment, you probably don't 
want to use the Principal or PrincipalAware interface, or even to wrap 
the HttpServletRequest (this email was in response to using a servlet 
wrapper to re-implement code already present in s2).


Options I've used are creating an interceptor to access the security 
context (I've not used JAAS personally), and then create an annotation 
to signify actions/methods that need security information assigned to 
them.  The same annotation, or another, could also be used to 
declaratively configure those actions that require a specific role from 
the security context in order to be invoked.


/Ian

Chris Pratt wrote:

On 9/18/07, Ian Roughley [EMAIL PROTECTED] wrote:
  

By implementing the PrincipalAware interface, the Principal object will
be injected into the action with those values from the request (the
user, roles, etc.).  The values can be be used in the action, or the
Principal can be exposed with a setter for the actions to use.



But if you don't use Container Managed Authentication, how do you get
the Principal into the request so that PrincipalAware can inject it,
without using a ServletFilter?
  (*Chris*)

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

  


Re: More tutorial questions

2007-09-18 Thread Dave Newton
--- Jim Cushing [EMAIL PROTECTED] wrote:
 Is running Java 5 an option for you? If not, you
 might be able to re-compile XWork for 1.4.

Or use the retrotranslater included in the S2 download
and convert the XWork jar as well as the S2 ones
already converted.

d.


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



RE: Struts 2 tutorial

2007-09-18 Thread Dave Newton
--- Wesley Wannemacher [EMAIL PROTECTED]
wrote:
 Struts2 is heavily based on WebWork,
 which uses xwork. I am not sure if this will be
 re-factored out. 

Almost everything in S2 *is* XWork; I don't see how
(or why) it would or could be refactored out.

d.


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



RE: More tutorial questions

2007-09-18 Thread Slattery, Tim - BLS
 That class was built for JDK 1.5/Java 5, and you're running JDK 1.4.

Ahh.
 
 Is running Java 5 an option for you? If not, you might be 
 able to re- compile XWork for 1.4.

Eventually. At the moment we're using BEA Weblogic 8.x. That supports
java 1.4, and it doesn't support servlets 1.4 either. We've looked at
Weblogic 9.x, but it seems to be flakey. I think it'll be a while before
we move up.


--
Tim Slattery
[EMAIL PROTECTED]


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



Re: Struts2 sitemesh problem finding xwork2

2007-09-18 Thread Ed Knutson
I am having a similar problem with WebSphere 6.0 using the j4 distro (I had to 
retrotranslate the Sitemesh plugin).  In my case, the NoClassDefFoundError was 
for org.apache.struts2.sitemesh.TemplatePageFilter, which per the docs is to be 
used in place of com.opensymphony.module.sitemesh.filter.PageFilter.  When I 
use the regular Sitemesh PageFilter, the error goes away but I am unable to 
access the ActionContext.  Since in my case as in yours the missing class 
files are indeed present, I think this is either a classloader issue or another 
error/exception that is being re-thrown for some reason as a 
NoClassDefFoundError.  Does anyone have any insight as to why this might be 
happening?


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



Re: Struts2 Portlets slowing down liferay portal

2007-09-18 Thread tom tom
Have one log4j setting for all the projects,

Thanks

--- Clark O'Brien [EMAIL PROTECTED] wrote:

 Setting the freemarker_update_delay improved
 performance for sure.
 
 Hate to ask such a simple question but just own do I
 change the devMode option and logging - my log4j.xml
 has ERROR set for logging but I am getting INFO on
 the
 console.
Clark
 
 
 
 --- Nils-Helge Garli [EMAIL PROTECTED] wrote:
 
  Hi!
  
  Is it just the page the portlet is on? Have you
  tried switching of
  devMode and logging? There  should be no extra
  performance hit
  compared to a basic Struts 2 application, so the
  performance tuning
  information in the documentation should apply:
 

http://struts.apache.org/2.x/docs/performance-tuning.html
  
  And if you just need a basic portlet, just remove
  the things from the
  configuration that you don't need, or start from
  scratch.
  
  You can also try a snapshot of Struts 2.1 and see
 if
  that helps. The
  portlet support in 2.1 and 2.0.10 should be
 greatly
  improved.
  
  Nils-H
  
  On 9/18/07, Clark O'Brien [EMAIL PROTECTED]
  wrote:
   Hi,
   I just downloaded struts2 a couple days ago and
  built
   a basic portlet with it. When I added the
 portlet
  the
   entire portal became dog slow. When I remove the
   portlet it is performant again.
  
   Can someone tell me why this would be happening.
   Also I don't want spring, caching,... I just
 want
  a
   basic portlet.
  
   clark
  
  
  
  
 


   Yahoo! oneSearch: Finally, mobile search
   that gives answers, not web links.
  
 

http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
  
  
 

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



 Building a website is a piece of cake. Yahoo! Small
 Business gives you all the tools to get online.
 http://smallbusiness.yahoo.com/webhosting 
 

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



   

Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mailp=summer+activities+for+kidscs=bz
 

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



Re: [S2] Issues with AJAX in IE

2007-09-18 Thread Grish

Hi,

Thanks for the reply! I was out of the office so I was only able to try it
out now. It works so I guess I'll use this approach for now. I applied some
CSS using display: none. Again not the most elegant approaches but I guess
it will do. 

Is this really some bug? If anyone has other ways to address this feel free
to share :)

Thanks again for the input!


Meteora wrote:
 
 Hi, i had exactly the same problem but i noticed it just happens when you
 have a single textfield. If you have 2 or more textfields... it works for
 me. Did you try with more textfields? I solved in this way: where i just
 have a single textfield, i add another invisible textfield (with border =
 0) so it works in IE also (when you hit enter button).
 I know it could not be the correct way to do it but if it is really a
 bug at least this solution works.  :)
 Let me know if it works for you too, i hope so. Bye.
 
 
 
 
 Grish wrote:
 
 
 But in IE, when I hit enter button instead of clicking on my submit
 button the whole jsp for that ajax call is displayed instead of returning
 the output in the DIV area. With Firefox there is no issue. I've noticed
 this in IE 6 and 7.
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Issues-with-AJAX-in-IE-tf4210453.html#a12770357
Sent from the Struts - User mailing list archive at Nabble.com.


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



Resulting HTML for InputTransferSelect generates errors

2007-09-18 Thread Shoaib Gauhar

Hello:

I am using Struts 2 and need to add InputTransferSelect in my JSP page. I am
adding the following code in my JSP page.

  s:inputtransferselect
name=insertionFields.map['TRTMNT_TYPE_CODE'] label=Trtmnt Type Code
list={'1','2','3','4'} theme=ajax /

But it generates error when this page is converted into HTML page. The
problem is with 'TRTMNT_TYPE_CODE' in the name attribute. Actually, the
Struts 2 does not convert the apostrophe into underscore. That is why it
generates error. The page does appear correctly but the up down select all
buttons do not work due to invalid character in the js script. 

Is there any solution to this problem. I must use the map  (HashMap) in this
way in the name attribute.

Thanks in advance.

Shoaib

-- 
View this message in context: 
http://www.nabble.com/Resulting-HTML-for-InputTransferSelect-generates-errors-tf4478887.html#a12771048
Sent from the Struts - User mailing list archive at Nabble.com.


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