You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Umesh Awasthi <um...@gmail.com> on 2013/10/25 09:41:51 UTC

"DelegatingValidatorContext.getText and Jetty

Hi All,

I have not worked much with jetty so not sure if my approach is correct or
not.
I am testing my application and few validation use cases on Jetty, though
validation is working correctly but when it come to resolve those error
messages with underlying Resource bundle its not working correctly

I have following property in my action class

 @NotBlank(message="not.blank")
   private String name;

I have one property file with same name as my action class and in same
directory with following entry

not.blank=Field can not be empty

This is how i am trying to get value against key in my code

 ValidatorContext validatorContext = new DelegatingValidatorContext( action
);
  message = validatorContext.getText(key);

here key being passed is "not.blank", but it is unable to get any value for
given key.
I tested same example with tomcat and everything is working fine

Do i need to add anything extra in Jetty configuration?
I am using org.mortbay.jetty plugin for Maven


-- 
With Regards
Umesh Awasthi
http://www.travellingrants.com/

Re: "DelegatingValidatorContext.getText and Jetty

Posted by Umesh Awasthi <um...@gmail.com>.
Hi Lukasz,

i used everything same as we have
https://github.com/lukaszlenart/struts2-jsr303-example

All I added few examples and tried t0 run those using jetty.

On running those, i was getting no messages, but message keys as output and
on debugging it , i found that  validatorContext.getText(key); was not able
to find any message associated with key.

Same was working fine on Tomcat.

You can run those sample example on Jetty to see issue.

Thanks
Umesh


On Tue, Oct 29, 2013 at 4:29 PM, Lukasz Lenart <lu...@apache.org>wrote:

> 2013/10/25 Umesh Awasthi <um...@gmail.com>:
> > Do i need to add anything extra in Jetty configuration?
> > I am using org.mortbay.jetty plugin for Maven
>
> Can you share how do you setup the plugin?
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
With Regards
Umesh Awasthi
http://www.travellingrants.com/

Re: "DelegatingValidatorContext.getText and Jetty

Posted by Lukasz Lenart <lu...@apache.org>.
2013/10/25 Umesh Awasthi <um...@gmail.com>:
> Do i need to add anything extra in Jetty configuration?
> I am using org.mortbay.jetty plugin for Maven

Can you share how do you setup the plugin?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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