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.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



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 
funny, though.


One of the interceptors in the defaultStack must be analyzing my 
action's annotations and then setting the appropriate error messages, I 
just can't figure out which one it is :-(


Er... The "validation" interceptor?

Dave

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



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 I'm trying to do: I need the errors from 
the ValidationAware interface to get set based on my actions 
@VisitorFieldValidator annotation.


One of the interceptors in the defaultStack must be analyzing my 
action's annotations and then setting the appropriate error messages, I 
just can't figure out which one it is :-(


Thanks!
Steven


Dave Newton wrote:

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 super.validate() which will run XML/annotation validations. From 
there you can call hasFieldErrors()/hasActionErrors()/etc. to 
determine if there were any.


Dave

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




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



Re: 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 ActionSupport
{
  private String somethingExtra;

  public String execute()
  {
if
(ActionContext.getContext().getName().equalsIgnoreCase("specialAction"))
   this.somethingExtra = "I just set something extra dude!";
return SUCCESS;
   }


}

On Thu, Jun 11, 2009 at 8:25 PM, akoo  wrote:

>
> 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 context:
> http://www.nabble.com/checking-which-action-on-the-jsp-tp23991107p23991107.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: 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 
super.validate() which will run XML/annotation validations. From there 
you can call hasFieldErrors()/hasActionErrors()/etc. to determine if 
there were any.


Dave

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



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 commands, e-mail: user-h...@struts.apache.org



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 template/ajax/treenode-include.ftl.
The problematic instruction:
--
==> ${stack.findValue(parameters.nodeTitleProperty)} [on line 23, column 
46 in template/ajax/treenode-include.ftl]
 in include "/${parameters.templateDir}/ajax/treenode-include.ftl" [on 
line 124, column 5 in template/ajax/tree.ftl]
--

Java backtrace for programmers:
--
freemarker.core.InvalidReferenceException: Expression 
stack.findValue(parameters.nodeTitleProperty) is undefined on line 23, 
column 48 in template/ajax/treenode-include.ftl.



Thanks & Regards
Bala T Ramanadham



NOTICE TO RECIPIENT:  If you are not the intended recipient of this 
e-mail, you are prohibited from sharing, copying, or otherwise using or 
disclosing its contents.  If you have received this e-mail in error, 
please notify the sender immediately by reply e-mail and permanently 
delete this e-mail and any attachments without reading, forwarding or 
saving them.  Thank you.


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 context: 
http://www.nabble.com/checking-which-action-on-the-jsp-tp23991107p23991107.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: 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:
>
>
> public class CreateUserAction extends ActionSupport implements
> ModelDriven {
> private User user = new User();
>   private IUserDao userService = new UserDao();
> public String execute() {
>   if ( this.userService.save(this.user) ) {
>   return SUCCESS;
>   }
>   else {
>   return INPUT;
>   }
>   }
> @VisitorFieldValidator(message="", shortCircuit = false, appendPrefix =
> false)
>   public User getModel() {
>   return this.user;
>   }
> public void setModel(User user) {
>   this.user = user;
>   }
> }
>
>
> Is there anyway to manually check possible validation errors on this action
> as if it were called by the Validation interceptor?
>
> Thanks,
> Steven
>
>
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


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(this.user) ) {
   return SUCCESS;
   }
   else {
   return INPUT;
   }
   }
   
   @VisitorFieldValidator(message="", shortCircuit = false, 
appendPrefix = false)

   public User getModel() {
   return this.user;
   }
   
   public void setModel(User user) {

   this.user = user;
   }
}


Is there anyway to manually check possible validation errors on this 
action as if it were called by the Validation interceptor?


Thanks,
Steven





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



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 initialized... Try
> annotating the test class with something like the following -
>
> @RunWith(SpringJUnit4ClassRunner.class)
> @ContextConfiguration(locations={"classpath*:applicationContext-test.xml"})
> public class ...
>
>
> That's the easy way, but if you are using an older JDK|JUnit then
> you'll have to figure out how to start Spring.
>
> -Wes
>
> On Thu, Jun 11, 2009 at 11:25 AM, stanlick wrote:
> >
> > 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 STRUTS-SPRING
> > INTEGRATION **
> > Looks like the Spring listener was not configured for your web app!
> > Nothing will work until WebApplicationContextUtils returns a valid
> > ApplicationContext.
> > You might need to add the following to web.xml:
> >
> >
> >
> org.springframework.web.context.ContextLoaderListener
> >
> >
> >
> > Why is the web.xml being considered?
> >
> > Peace,
> > Scott
> > --
> > View this message in context:
> http://www.nabble.com/StrutsTestCase-and-Spring-2.5-tp23983515p23983515.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>
>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


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.


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



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.HttpServletResponse res;
>
> then
> @Override
>    protected String determineActionURL(String action, String namespace, 
> String method,
>                                        HttpServletRequest req, 
> HttpServletResponse res, Map parameters, String scheme,
>                                        boolean includeContext, boolean 
> encodeResult, boolean forceAddSchemeHostAndPort,
>                                        boolean escapeAmp) {
>        this.res = res;
>        try
>        {
>         stream=res.getOutputStream();
>        }
>        catch(java.lang.Exception excp)
>        {
>          log.debug("OutputStream is null"+excp.getMessage());
>         }
>        String finalAction = findString(action);
>        String finalMethod = method != null ? findString(method) : method;
>        String finalNamespace = determineNamespace(namespace, getStack(), req);
>        ActionMapping mapping = new ActionMapping(finalAction, finalNamespace, 
> finalMethod, parameters);
>        String uri = actionMapper.getUriFromActionMapping(mapping);
>        return UrlHelper.buildUrl(uri, req, res, parameters, scheme, 
> includeContext, encodeResult, forceAddSchemeHostAndPort, escapeAmp);
>    }
> ...
> }
>
> http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletResponse.html#getOutputStream()
>
> y/n?
> Martin
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem Austausch von Informationen und entfaltet keine rechtliche 
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
> wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
> est interdite. Ce message sert à l'information seulement et n'aura pas 
> n'importe quel effet légalement obligatoire. Étant donné que les email 
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
> aucune responsabilité pour le contenu fourni.
>
>
>
>
>> Date: Thu, 11 Jun 2009 11:59:30 -0400
>> Subject: Re: [OT]Moving from Struts2 to grails, your thoughts
>> From: w...@wantii.com
>> To: user@struts.apache.org
>>
>> 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())+"";
>> >                //I want to put numQsAdded into a outputstream
>> >                return NONE;
>> >  }
>> >
>> >
>> > my action is implementing ServletRequestAware so I have access to
>> > the HttpServletRequest request
>> >
>>
>>
>> The OutputStream usually comes from the response (since you are
>> responding). I think you might be able to pull the ServletResponse out
>> of the ActionContext if you don't want to implement the interfaces.
>>
>> -Wes
>>
>>
>>
>> --
>> Wes Wannemacher
>> Author - Struts 2 In Practice
>> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
>> http://www.manning.com/wannemacher
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>
> _
> Windows Live™ SkyDrive™: Get 25 GB of free online storage.
> http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009



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

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



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 action, String namespace, String 
method,
HttpServletRequest req, 
HttpServletResponse res, Map parameters, String scheme,
boolean includeContext, boolean 
encodeResult, boolean forceAddSchemeHostAndPort,
boolean escapeAmp) {
this.res = res;
try
{
 stream=res.getOutputStream();
}
catch(java.lang.Exception excp)
{
  log.debug("OutputStream is null"+excp.getMessage());
 }
String finalAction = findString(action);
String finalMethod = method != null ? findString(method) : method;
String finalNamespace = determineNamespace(namespace, getStack(), req);
ActionMapping mapping = new ActionMapping(finalAction, finalNamespace, 
finalMethod, parameters);
String uri = actionMapper.getUriFromActionMapping(mapping);
return UrlHelper.buildUrl(uri, req, res, parameters, scheme, 
includeContext, encodeResult, forceAddSchemeHostAndPort, escapeAmp);
}
...
}

http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletResponse.html#getOutputStream()

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




> Date: Thu, 11 Jun 2009 11:59:30 -0400
> Subject: Re: [OT]Moving from Struts2 to grails, your thoughts
> From: w...@wantii.com
> To: user@struts.apache.org
> 
> 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())+"";
> >//I want to put numQsAdded into a outputstream
> >return NONE;
> >  }
> >
> >
> > my action is implementing ServletRequestAware so I have access to
> > the HttpServletRequest request
> >
> 
> 
> The OutputStream usually comes from the response (since you are
> responding). I think you might be able to pull the ServletResponse out
> of the ActionContext if you don't want to implement the interfaces.
> 
> -Wes
> 
> 
> 
> -- 
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Windows Live™ SkyDrive™: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009

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 (addNewQuestion () == 1)
> > {
> >String numQsAdded = " > id='message1'>"+getQuestion().substring(1,
> getQuestion().length())+"";
> >//I want to put numQsAdded into a outputstream
> >return NONE;
> >  }
> >
> >
> > my action is implementing ServletRequestAware so I have access to
> > the HttpServletRequest request
> >
>
>
> The OutputStream usually comes from the response (since you are
> responding). I think you might be able to pull the ServletResponse out
> of the ActionContext if you don't want to implement the interfaces.
>
> -Wes
>
>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


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())+"";
>                //I want to put numQsAdded into a outputstream
>                return NONE;
>  }
>
>
> my action is implementing ServletRequestAware so I have access to
> the HttpServletRequest request
>


The OutputStream usually comes from the response (since you are
responding). I think you might be able to pull the ServletResponse out
of the ActionContext if you don't want to implement the interfaces.

-Wes



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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



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
return NONE;
 }


my action is implementing ServletRequestAware so I have access to
the HttpServletRequest request

On Thu, Jun 11, 2009 at 1:43 AM, Musachy Barroso  wrote:

> you can get a reference to the outputstream from the request and write
> to it, and then return null, or Action.NONE from your method.
>
> musachy
>
> On Thu, Jun 11, 2009 at 12:25 AM, Bhaarat Sharma
> wrote:
> > thanks for your been there done that insight.
> >
> > Struts 2 definitely is much more sane and enterprise level compared to
> > grails.  However, sometimes it is disappointing to know that in struts
> > out-of-the-box we cant even return a result type of a simple string that
> > does not go to a different page.  Say, I just want to stream out a string
> > and not go to a completly different page (this is helpfull for Ajax).  So
> I
> > end up making a whole new .jsp page that just has  > value="something"/> in it ...
> >
> > I will give grails a fair try.
> >
> > On Thu, Jun 11, 2009 at 12:10 AM, David C. Hicks 
> wrote:
> >
> >> I think Grails is a nice tool, as long as what you want to do is within
> the
> >> confines of what it is designed to give you for free.  After that,
> you'll be
> >> writing mounds of code.  The project I'm working on now was originally
> >> started on the Grails platform.  It was maybe 5 to 6 months down the
> road
> >> when we finally could not push Grails any further without essentially
> >> writing our own framework.  So, we re-wrote the entire thing using
> >> Struts/Hibernate/Spring.  We are all *MUCH* happier, now.
> >>
> >> Other frameworks of a similar nature:  Spring-MVC.  Very well done.
> >> Other languages?  too many to go into
> >>
> >> If you just want to be able to quickly throw together a very basic
> >> web-based application that does a very specific kind of data
> >> entry/edit/view, then Grails/Rails are great tools.  (I prefer Grails,
> >> personally.)  Anything more?  Struts or Spring-MVC would be my choices.
> >>
> >> Dave
> >>
> >>
> >>
> >> Bhaarat Sharma wrote:
> >>
> >>> Guys,
> >>>
> >>> I've been doing struts2 for about 2 years, although I dont know
> everything
> >>> about it but I have been able to get the stuff done.  Most of the stuff
> I
> >>> learned was from Struts2 in action book and this mailing list!
> >>>
> >>> Lately I've been intrigued by the XXX on Rails framework, be it Ruby or
> >>> Groovy.  So I am planning to sit down and teach myself Grails.
> >>>
> >>> I wanted some of your thoughts:
> >>>
> >>> What other Frameworks have you learned before/after Struts2?
> >>>
> >>> Apart from Java, What other languages have you been involved in?
> >>>
> >>> Hopefully, this isnt too Off topic :)
> >>>
> >>>
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


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*:applicationContext-test.xml"})
public class ...


That's the easy way, but if you are using an older JDK|JUnit then
you'll have to figure out how to start Spring.

-Wes

On Thu, Jun 11, 2009 at 11:25 AM, stanlick wrote:
>
> 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 STRUTS-SPRING
> INTEGRATION **
> Looks like the Spring listener was not configured for your web app!
> Nothing will work until WebApplicationContextUtils returns a valid
> ApplicationContext.
> You might need to add the following to web.xml:
>    
>
> org.springframework.web.context.ContextLoaderListener
>    
>
>
> Why is the web.xml being considered?
>
> Peace,
> Scott
> --
> View this message in context: 
> http://www.nabble.com/StrutsTestCase-and-Spring-2.5-tp23983515p23983515.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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



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 STRUTS-SPRING
INTEGRATION **
Looks like the Spring listener was not configured for your web app! 
Nothing will work until WebApplicationContextUtils returns a valid
ApplicationContext.
You might need to add the following to web.xml: 

   
org.springframework.web.context.ContextLoaderListener



Why is the web.xml being considered?

Peace,
Scott
-- 
View this message in context: 
http://www.nabble.com/StrutsTestCase-and-Spring-2.5-tp23983515p23983515.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: 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 useless traffic to our server.

While we cannot 100% protect the images from inclusion, we can at least 
restrict the cases where the browser
sends a HTTP Referer header.

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://www.quux-corp.de/~quux/.*$ [NC]
RewriteRule .*\.gif$ - [F]

^$
^http://www.quux-corp.de/~quux/.*$
.*\.gif$
null
403


Blocked Inline-Images example 2

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !.*/foo-with-gif\.html$
RewriteRule ^inlined-in-foo\.gif$ - [F]

^$
.*/foo-with-gif\.html$
^inlined-in-foo\.gif$
null
403

the above rule is an example of sniffing HTTP_REFERER for URL not 
http://www.quux-corp.de/~quux/.*
in which case a 403 is returned

http://tuckey.org/urlrewrite/manual/2.6/guide.html

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

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




> Date: Thu, 11 Jun 2009 10:37:10 -0400
> From: d...@newfield.org
> To: user@struts.apache.org
> Subject: Re: Return to previous page without javascript
> 
> 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 from which any form is submitted is 
> usually told to the server by the browser even without sticking it in a 
> hidden field (which is more easily spoofed).  The HTTP specification 
> misspelled it as the "referer" field, and you can ask the request object 
> for the value.  http://en.wikipedia.org/wiki/HTTP_referrer
> 
> -Dale
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Windows Live™ SkyDrive™: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009

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
break, which I think is the only real consideration because I'd expect the
browser to handle the content regardless of what what charset it uses once
it's opened in the new window.

I may be very wrong of course :)

-- 
Frank W. Zammetti
Author of "Practical Ext JS Projects with Gears" (coming soon)
  and "Practical Dojo Projects"
  and "Practical DWR 2 Projects"
  and "Practical JavaScript, DOM Scripting and Ajax Projects"
  and "Practical Ajax Projects with Java Technology"
  (For info: apress.com/book/search?searchterm=zammetti&act=search)
All you could possibly want is here: zammetti.com

On Thu, June 11, 2009 10:58 am, Martin Gainty wrote:
>
> 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
> __
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie de ceci est interdite. Ce message sert à l'information seulement et
> n'aura pas n'importe quel effet légalement obligatoire. Étant donné que
> les email peuvent facilement être sujets à la manipulation, nous ne
> pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>> Date: Thu, 11 Jun 2009 10:07:20 -0400
>> Subject: Re: opening a popup window from Action Class
>> From: fzli...@omnytex.com
>> To: user@struts.apache.org
>>
>> 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 "Practical DWR 2 Projects"
>>   and "Practical JavaScript, DOM Scripting and Ajax Projects"
>>   and "Practical Ajax Projects with Java Technology"
>>   (For info: apress.com/book/search?searchterm=zammetti&act=search)
>> All you could possibly want is here: zammetti.com
>>
>> On Thu, June 11, 2009 2:03 am, abhishek reddy wrote:
>> > hi every one,
>> >
>> > How to open a popup window from Struts Action Class?
>> >
>> > thanks in advance
>> > --
>> > Abhishek
>> >
>>
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>
> _
> Insert movie times and more without leaving Hotmail®.
> http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009



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



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 should reflect 
> without restart/redeploy.
>
> Is this possible in Struts2?
>
> Please clarify.
>
> Thank you.
> Regards,
> Kishan.G
>
> Team Leader.
> www.spansystems.com
>
>
>
>
> -Original Message-
> From: Kishan G. Chellap Paandy [mailto:kishanchellapaand...@spanservices.com]
> Sent: Friday, May 29, 2009 1:34 PM
> To: Struts Users Mailing List
> Subject: Struts 2.1.6 - reload resource bundles
>
> Hi,
>
> I want to reload resource bundles (application resources) dynamically for 
> i18n.
>
> Since it is production, I can't set dev mode struts property to true.
>
> Does setting only the struts2 property i18n.reload to true will solve my 
> problem?
>
> Is there is any other workaround like doing it programmatically?
>
> Please advice.
>
> Thank you.
> Regards,
> Kishan.G
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



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

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



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




> Date: Thu, 11 Jun 2009 10:07:20 -0400
> Subject: Re: opening a popup window from Action Class
> From: fzli...@omnytex.com
> To: user@struts.apache.org
> 
> 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 "Practical DWR 2 Projects"
>   and "Practical JavaScript, DOM Scripting and Ajax Projects"
>   and "Practical Ajax Projects with Java Technology"
>   (For info: apress.com/book/search?searchterm=zammetti&act=search)
> All you could possibly want is here: zammetti.com
> 
> On Thu, June 11, 2009 2:03 am, abhishek reddy wrote:
> > hi every one,
> >
> > How to open a popup window from Struts Action Class?
> >
> > thanks in advance
> > --
> > Abhishek
> >
> 
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Insert movie times and more without leaving Hotmail®. 
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009

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",'sPhone':'212-555-1234'}

What you need is serialization and deserialization. Going from Java to
JavaScript, the most common method is to use JSON. Struts has a JSON
result type (available as a plugin). What you need to do is install
the plugin into your app. Then, you need to specify that you specify a
result of type JSON for Dojo to request. There is ample documentation
for processing JSON via Dojo.

-Wes

On Thu, Jun 11, 2009 at 10:46 AM, Rafael
Taboada wrote:
> 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;
> }
>
> xhrPost receives results in a load function. And here, I need to get the
> Client result in order to fill some controls.
>
> load: function(ClientResult) {
>  dijit.byId('name').innerHTML = ClientResult.sName;
>  dijit.byId('phone').innerHTML = ClientResult.sPhone;
>
> }
>
> How can I do that? Is it possible Struts2 can send objects as a result
> type?.
>
> --
> Rafael Taboada
> Software Engineer
>
> Cell : +511-992741026
>
> "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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



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;
}

xhrPost receives results in a load function. And here, I need to get the
Client result in order to fill some controls.

load: function(ClientResult) {
  dijit.byId('name').innerHTML = ClientResult.sName;
  dijit.byId('phone').innerHTML = ClientResult.sPhone;

}

How can I do that? Is it possible Struts2 can send objects as a result
type?.

-- 
Rafael Taboada
Software Engineer

Cell : +511-992741026

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"


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 from which any form is submitted is 
usually told to the server by the browser even without sticking it in a 
hidden field (which is more easily spoofed).  The HTTP specification 
misspelled it as the "referer" field, and you can ask the request object 
for the value.  http://en.wikipedia.org/wiki/HTTP_referrer


-Dale

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



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 "Practical DWR 2 Projects"
  and "Practical JavaScript, DOM Scripting and Ajax Projects"
  and "Practical Ajax Projects with Java Technology"
  (For info: apress.com/book/search?searchterm=zammetti&act=search)
All you could possibly want is here: zammetti.com

On Thu, June 11, 2009 2:03 am, abhishek reddy wrote:
> hi every one,
>
> How to open a popup window from Struts Action Class?
>
> thanks in advance
> --
> Abhishek
>



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



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




-Original Message-
From: Kishan G. Chellap Paandy [mailto:kishanchellapaand...@spanservices.com] 
Sent: Friday, May 29, 2009 1:34 PM
To: Struts Users Mailing List
Subject: Struts 2.1.6 - reload resource bundles

Hi,

I want to reload resource bundles (application resources) dynamically for i18n.

Since it is production, I can't set dev mode struts property to true.

Does setting only the struts2 property i18n.reload to true will solve my 
problem?

Is there is any other workaround like doing it programmatically?

Please advice.

Thank you.
Regards,
Kishan.G



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



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 Collings [mailto:jlistn...@gmail.com] 
Sent: Thursday, June 11, 2009 5:54 PM
To: Struts Users Mailing List
Subject: Whats the best way to do validation messages on the same page?

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,
selecting submit will display some errors on that page but will not
move on to a different page.
All of these pages are in the /content dir so if I have:

some-file.jsp and SomeFileAction.java and if SomeFileAction extends
ActionSupport implements Preparable, then execute() is going to get
called when ever the page is loaded even though it's empty and just
returns "success"... I have to override and annotate execute with
@SkipValidation to prevent messages from being displayed when the user
has first loaded the page. The form on the some-file.jsp calls
some-file!doSomething when the Submit button is selected. This turns
things into a real mess. What the convention plugin does is consistent
but not always predictable. I basically had to break with the
conventions and use a few @Results and an additional action to get
some predictability out of it.

Anyway... how would you have done this?


Jim C.

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


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



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-portlet-plugin-2.1.6) seems to break my existing web pages. For
example, when I have an action which forwards onto a very plain jsp file
that shows a form (using ) I get a NullPointerException as below:

org.apache.jasper.JasperException: java.lang.NullPointerException

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:415)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   etc...

root cause

java.lang.NullPointerException
org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)
org.apache.struts2.components.UIBean.end(UIBean.java:510)

org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)

org.apache.jsp.cardSearch_jsp._jspx_meth_s_005ftextfield_005f0(cardSearch_jsp.java:583)

org.apache.jsp.cardSearch_jsp._jspx_meth_s_005fform_005f0(cardSearch_jsp.java:530)
org.apache.jsp.cardSearch_jsp._jspService(cardSearch_jsp.java:296)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)

org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
etc.

If I remove the portlet plugin (and the portlet.xml file which points to one
of the classes from the plugin) all of my original webpages work without any
issues so it's definetly the plugin that's causing a conflict.

Can I not deploy a struts2 application that includes both normal web pages
and portlets? Or is there a way around this problem. 

Any help would be greatly appreciated.

Iain.
-- 
View this message in context: 
http://www.nabble.com/Error-when-deploying-portlets-beside-a-normal-Struts2-web-app--tp23981728p23981728.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: 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 the
receiving end? Are you planning to utilize the object with JavaScript,
a Java Applet, a .Net somethingorother?

-Wes

On Thu, Jun 11, 2009 at 9:44 AM, Rafael
Taboada wrote:
> 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"
>



-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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



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: 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.apache.org
> 
> 
> 

Yes, I streamed it from an action. However, I could show the above table
using an action to stream images.
-- 
View this message in context: 
http://www.nabble.com/Performance-issue-with-large-data%28such-as-images%29-tp23945029p23981525.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: 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 on a page that adds a record and I leave all the fields blank,
> selecting submit will display some errors on that page but will not
> move on to a different page.
> All of these pages are in the /content dir so if I have:
>
> some-file.jsp and SomeFileAction.java and if SomeFileAction extends
> ActionSupport implements Preparable, then execute() is going to get
> called when ever the page is loaded even though it's empty and just
> returns "success"... I have to override and annotate execute with
> @SkipValidation to prevent messages from being displayed when the user
> has first loaded the page. The form on the some-file.jsp calls
> some-file!doSomething when the Submit button is selected. This turns
> things into a real mess. What the convention plugin does is consistent
> but not always predictable. I basically had to break with the
> conventions and use a few @Results and an additional action to get
> some predictability out of it.
>
> Anyway... how would you have done this?


Generally, I leave execute to actually do the work... I mean, rather
than present a form on the page returned by the "success" result, I
will make the first stop to a page be the "input" result. If you link
your users to the "input" result, then, even though the form fields
are empty, struts will skip validation (by default). It is from this
page that I will submit to the execute method of the action. It's hard
to draw a flowchart in an email, but typical process flow is like this
-

landing page -> process form
"input" result"execute" method

At this point, if validation fails, the framework will send the user
to the "input" result with validation errors, or continue to the
"success" result.

I think most of the CRUD tutorials and examples in the docs follow a
similar flow.

It is not that it is a requirement to do it this way. But, I'm pretty
sure this is the "convention" that the conventions plugin is meant to
provide. Of course, you can break out of it by configuring things
(using the @Result(s) annotation, changing interceptor configuration
for how validation is run, and using the @SkipValidation annotation).

-Wes

-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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



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,
selecting submit will display some errors on that page but will not
move on to a different page.
All of these pages are in the /content dir so if I have:

some-file.jsp and SomeFileAction.java and if SomeFileAction extends
ActionSupport implements Preparable, then execute() is going to get
called when ever the page is loaded even though it's empty and just
returns "success"... I have to override and annotate execute with
@SkipValidation to prevent messages from being displayed when the user
has first loaded the page. The form on the some-file.jsp calls
some-file!doSomething when the Submit button is selected. This turns
things into a real mess. What the convention plugin does is consistent
but not always predictable. I basically had to break with the
conventions and use a few @Results and an additional action to get
some predictability out of it.

Anyway... how would you have done this?


Jim C.

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