Whats the best way to do validation messages on the same page?

2009-06-11 Thread Jim Collings
There's got to be a better way of doing this than the way that I am doing it. Convention plugin. According to my projects requirements error/validation/success messages are supposed to show on the jsp that generated them. So if I am on a page that adds a record and I leave all the fields blank, s

Re: Whats the best way to do validation messages on the same page?

2009-06-11 Thread Wes Wannemacher
On Thu, Jun 11, 2009 at 8:23 AM, Jim Collings wrote: > There's got to be a better way of doing this than the way that I am doing it. > > Convention plugin. > > According to my projects requirements error/validation/success > messages are supposed to show on the jsp that generated them. So if I > am

Re: Performance issue with large data(such as images)

2009-06-11 Thread fireapple
newton.dave wrote: > > >> "" doesn't work at >> all. > > Stream it from an action/servlet/etc? > > Dave > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.

Re: how to return xml from struts2 action class

2009-06-11 Thread Rafael Taboada
Hi! What if I need to return another data apart from XML? I need to return an object. How can I return this type? Thanks in advance. -- Rafael Taboada Software Engineer Cell : +511-992741026 "No creo en el destino pues no me gusta tener la idea de controlar mi vida"

Re: how to return xml from struts2 action class

2009-06-11 Thread Wes Wannemacher
An object? Like a hula hoop? Objects exist within memory, but their binary representation is going to differ from platform to platform. Things like XML and JSON allow you to serialize objects to a readable / transmittable format so that they can be deserialized by the receiver. What do you have on

Error when deploying portlets beside a normal Struts2 web app?

2009-06-11 Thread IainM
Hi, I have an existing Struts2 (2.1.6) web app which I would like to add a couple of portlets to. I have added the portlet plugin and a portel.xml file and developed a couple of plugins which I have successfully run in JBOSS Portal. My problem is that the addition of the portlet plugin (struts2-p

RE: Whats the best way to do validation messages on the same page?

2009-06-11 Thread Kishan G. Chellap Paandy
Hi Jim, You can exclude methods (in your case execute method) from validation using workflow interceptor exclude methods parameter. execute May be this could help. Thank you. Regards, Kishan.G Team Leader. www.spansystems.com -Original Message- From: Jim Colling

RE: Struts 2.1.6 - reload resource bundles

2009-06-11 Thread Kishan G. Chellap Paandy
Hi, I need to reload resource bundles not for every request, but only when I have changed them dynamically (when the server is running), and it should reflect without restart/redeploy. Is this possible in Struts2? Please clarify. Thank you. Regards, Kishan.G Team Leader. www.spansystems.com

Re: opening a popup window from Action Class

2009-06-11 Thread Frank W. Zammetti
This is a question asked so frequently that someone should create an FAQ entry or something. Oh, wait... http://wiki.apache.org/struts/OpenWindowFromAction :) Frank -- Frank W. Zammetti Author of "Practical Ext JS Projects with Gears" (coming soon) and "Practical Dojo Projects" and "Pract

Re: Return to previous page without javascript

2009-06-11 Thread Dale Newfield
Stefano Tranquillini wrote: i want to do a thing. When a user do the login (i've the login in the left part of the web site, so in each pages the user can do the login) i want to redirect he at the pages that was visit before the login. how can i do that? (no JS) Nobody mentioned that the page

Re: how to return xml from struts2 action class

2009-06-11 Thread Rafael Taboada
Excuse my english please. I'm using Dojo to manage AJAX calls In my jsp, I call an Struts Action with dojo.xhrPost, but my action returns another jsp, but I need to receive a Client bean with some data as a result type public class Client() { private String sName; private String sPhone; } x

Re: how to return xml from struts2 action class

2009-06-11 Thread Wes Wannemacher
I don't think you understood my last post... Dojo is JavaScript, struts actions are Java. A JavaScript object is not the same thing as a Java object... Here is how a Java object looks - 00101001010100100101000100101010100100010010011 Here is how a JavaScript object looks - {'sName':"My Name",'sP

RE: opening a popup window from Action Class

2009-06-11 Thread Martin Gainty
yes that works for UTF-8 with text/html http://www.dojotoolkit.com/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/i18n/encoding-considerations how would you accomodate a different charset such as GB18030 http://en.wikipedia.org/wiki/Chinese_character_encoding ? Martin Gainty __

Re: Struts 2.1.6 - reload resource bundles

2009-06-11 Thread Musachy Barroso
I don't think it will work without without setting devMode to true. musachy On Thu, Jun 11, 2009 at 6:58 AM, Kishan G. Chellap Paandy wrote: > Hi, > > I need to reload resource bundles not for every request, but only when I have > changed them dynamically (when the server is running), and it sho

RE: opening a popup window from Action Class

2009-06-11 Thread Frank W. Zammetti
I assume you're referring specifically to the AJAX option outlined on that page... in that case, I have to admit I've never dealt with that scenario so I'm not certain... but, wouldn't just escaping quotes in the response on the server-side do the trick? That would ensure the JavaScript doesn't br

RE: Return to previous page without javascript

2009-06-11 Thread Martin Gainty
if you want to use tuckey URLRewriteFilter Blocked Inline-Images Assume we have under http://www.quux-corp.de/~quux/ some pages with inlined GIF graphics. These graphics are nice, so others directly incorporate them via hyperlinks to their pages. We don't like this practice because it adds us

StrutsTestCase and Spring 2.5

2009-06-11 Thread stanlick
I am on a project with a new combination of jars and testing Struts interceptors. I have added the struts2-junit-plugin-2.1.2.jar and also spring-test.jar. When I run my subclass test of StrutsTestCase I get the following exception: SEVERE: [20:44.438] ** FATAL ERROR STARTING UP STRUT

Re: StrutsTestCase and Spring 2.5

2009-06-11 Thread Wes Wannemacher
Scott, it is just complaining because you are trying to do something Spring-ish in your unit test, but Spring is not initialized... Try annotating the test class with something like the following - @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath*:applicationCont

Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-11 Thread Bhaarat Sharma
This might be too simple ...but how will i get the outputstream? lets say I have something like this if (addNewQuestion () == 1) { String numQsAdded = ""+getQuestion().substring(1, getQuestion().length())+""; //I want to put numQsAdded into a outputstream

Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-11 Thread Wes Wannemacher
On Thu, Jun 11, 2009 at 11:53 AM, Bhaarat Sharma wrote: > This might be too simple ...but how will i get the outputstream? > lets say I have something like this > > if (addNewQuestion () == 1) > { >                String numQsAdded = " id='message1'>"+getQuestion().substring(1, getQuestion().length

Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-11 Thread Bhaarat Sharma
I just implemented servletResponseAware as well. Thanks! On Thu, Jun 11, 2009 at 11:59 AM, Wes Wannemacher wrote: > On Thu, Jun 11, 2009 at 11:53 AM, Bhaarat Sharma > wrote: > > This might be too simple ...but how will i get the outputstream? > > lets say I have something like this > > > > if (a

RE: [OT]Moving from Struts2 to grails, your thoughts

2009-06-11 Thread Martin Gainty
one of your UI beans can extend org.apache.struts2.components.Component e.g. public class MyBean extend org.apache.struts2.components.Component { javax.servlet.ServletOutputStream stream; javax.servlet.http.HttpServletResponse res; then @Override protected String determineActionURL(String

Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-11 Thread Musachy Barroso
Components are for tags On Thu, Jun 11, 2009 at 9:32 AM, Martin Gainty wrote: > > one of your UI beans can extend org.apache.struts2.components.Component e.g. > > public class MyBean extend org.apache.struts2.components.Component { > javax.servlet.ServletOutputStream stream; > javax.servlet.http.H

Re: Struts2 Session Invalidate.

2009-06-11 Thread Richard Xing
You can use the tag to set the session variable to empty string as below: -- View this message in context: http://www.nabble.com/Struts2-Session-Invalidate.-tp15627192p23988865.html Sent from the Struts - User mailing list archive at Nabble.com. -

Re: StrutsTestCase and Spring 2.5

2009-06-11 Thread stanlick
Thanks bro! I think I hated annotations until today. Was the StrutsTestCase moved into a plug-in recently? On Thu, Jun 11, 2009 at 10:41 AM, Wes Wannemacher wrote: > Scott, it is just complaining because you are trying to do something > Spring-ish in your unit test, but Spring is not initializ

Manually Checking Validation Errors on an Action

2009-06-11 Thread Steven Hansen
Hi, I'm trying to test some basic validations on an action: public class CreateUserAction extends ActionSupport implements ModelDriven { private User user = new User(); private IUserDao userService = new UserDao(); public String execute() { if ( this.userService.save

Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Bhaarat Sharma
you just have to write the validate method public void validate () { if (getModel().something()==null) addFieldError("question", "Something went wrong"); } On Thu, Jun 11, 2009 at 7:15 PM, Steven Hansen wrote: > > Hi, > > I'm trying to test some basic validations on an action: > > > pu

checking which action on the jsp

2009-06-11 Thread akoo
Hi, I have an jsp page which is used as a result by two actions. However if the request comes from one of the actions something extra needs to be on the page. Is there way I can access the action name on the jsp page. i.e print something extra here -- View this message in conte

Struts2 dynamic tree error

2009-06-11 Thread Bala . T . Ramanadham
Using the below code to create a tree reading DB. "customers"is an Array List and "customer"is an object. Below is the error. Please help 6/11/09 17:17:01:000 PDT] 0084 runtime E Expression stack.findValue(parameters.nodeTitleProperty) is undefined on line 23, column 48 in templ

Re: [OT]Moving from Struts2 to grails, your thoughts

2009-06-11 Thread Dave Newton
Musachy Barroso wrote: Components are for tags Maybe where *you're* from. Over here we use random classes for *all* our functionality! Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional command

Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Dave Newton
Steven Hansen wrote: Is there anyway to manually check possible validation errors on this action as if it were called by the Validation interceptor? The previous answer was partially correct, depending on what you're actually trying to do. If you implement a validate() method you can call sup

Re: checking which action on the jsp

2009-06-11 Thread Bhaarat Sharma
this should ideally be handled in your ActionClass. set that 'something extra' in your Action class and use the tag to see if it is there. if its there then just display it. /commonPage.jsp /commonPage.jsp import com.opensymphony.xwork2.ActionContext; public class MyClass extends

Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Steven Hansen
Are you sure that calling super.validate() from my action's implementation of validate() will invoke the XML/annotation validations? I'm extending ActionSupport, so super.validate() would call ActionsSupport's validate(), which is just an empty method .. But I think you understand what

Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Dave Newton
Steven Hansen wrote: Are you sure that calling super.validate() from my action's implementation of validate() will invoke the XML/annotation validations? Hmm, I guess it just does the XML/annotation validation automatically without the super. Too late to change it in the book. Oh well... Kinda

Re: Manually Checking Validation Errors on an Action

2009-06-11 Thread Steven Hansen
Er... The "validation" interceptor? Yeah, you're right, duh! I didn't realize that the validation interceptor is actually the AnnotationValidationInterceptor class :-P - To unsubscribe, e-mail: user-unsubscr...@struts.ap