You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alex Milanovic <al...@iogeo.com> on 2008/11/13 10:08:50 UTC

Struts2, REST, JSON content encoding, UTF8

Hi All,

I am using the REST plugin for Struts 2.1.3-SNAPSHOT. I want to make
sure that the content encoding for the JSON output from the server is
always in UTF8. How can I do this?

Thanks,
Alex

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


RE: How to read struts2 constants in action class

Posted by Manish Kumar Wadhwa <Ma...@niit.com>.
Great.... it works.....

Thanks so much Musachy... :)

Manish.

-----Original Message-----
From: Musachy Barroso [mailto:musachy@gmail.com]
Sent: Monday, November 24, 2008 10:51 PM
To: Struts Users Mailing List
Subject: Re: How to read struts2 constants in action class

use "@Inject".

@Inject("custom.myConstant")
public void setSomeString(String mystring) {...}

Things to note about that:

1. Struts needs to be the one creating your actions (no object factory from
an IoC, like Spring, Guice, etc)
2. This is not guaranteed to work in the future, but it is unlikely to
change anytime soon.

musachy

On Mon, Nov 24, 2008 at 5:37 AM, Manish Kumar Wadhwa <Manish.Wadhwa@niit.com
> wrote:

> Hi All,
>
> Is there a away to get the value of a constant, declared in the struts.xml
> file, in my action class?
>
> <constant name="custom.myConstant" value="true" />
>
> Thanks,
> Manish
>
>
> -------------------------------------------------------------------------------------------------------------
>
> DISCLAIMER
> This email and any files transmitted with it are confidential and are
> solely for the use of the individual or entity to which it is addressed. Any
> use, distribution, copying or disclosure by any other person is strictly
> prohibited. If you receive this transmission in error, please notify the
> sender by reply email and then destroy the message. Opinions, conclusions
> and other information in this message that do not relate to official
> business of the company shall be understood to be neither given nor endorsed
> by NIIT Ltd. Any information contained in this email, when addressed to
> Clients is subject to the terms and conditions in governing client contract.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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

-------------------------------------------------------------------------------------------------------------

DISCLAIMER
This email and any files transmitted with it are confidential and are solely for the use of the individual or entity to which it is addressed. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of the company shall be understood to be neither given nor endorsed by NIIT Ltd. Any information contained in this email, when addressed to Clients is subject to the terms and conditions in governing client contract.

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


Re: How to read struts2 constants in action class

Posted by Musachy Barroso <mu...@gmail.com>.
use "@Inject".

@Inject("custom.myConstant")
public void setSomeString(String mystring) {...}

Things to note about that:

1. Struts needs to be the one creating your actions (no object factory from
an IoC, like Spring, Guice, etc)
2. This is not guaranteed to work in the future, but it is unlikely to
change anytime soon.

musachy

On Mon, Nov 24, 2008 at 5:37 AM, Manish Kumar Wadhwa <Manish.Wadhwa@niit.com
> wrote:

> Hi All,
>
> Is there a away to get the value of a constant, declared in the struts.xml
> file, in my action class?
>
> <constant name="custom.myConstant" value="true" />
>
> Thanks,
> Manish
>
>
> -------------------------------------------------------------------------------------------------------------
>
> DISCLAIMER
> This email and any files transmitted with it are confidential and are
> solely for the use of the individual or entity to which it is addressed. Any
> use, distribution, copying or disclosure by any other person is strictly
> prohibited. If you receive this transmission in error, please notify the
> sender by reply email and then destroy the message. Opinions, conclusions
> and other information in this message that do not relate to official
> business of the company shall be understood to be neither given nor endorsed
> by NIIT Ltd. Any information contained in this email, when addressed to
> Clients is subject to the terms and conditions in governing client contract.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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

How to read struts2 constants in action class

Posted by Manish Kumar Wadhwa <Ma...@niit.com>.
Hi All,

Is there a away to get the value of a constant, declared in the struts.xml file, in my action class?

<constant name="custom.myConstant" value="true" />

Thanks,
Manish

-------------------------------------------------------------------------------------------------------------

DISCLAIMER
This email and any files transmitted with it are confidential and are solely for the use of the individual or entity to which it is addressed. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of the company shall be understood to be neither given nor endorsed by NIIT Ltd. Any information contained in this email, when addressed to Clients is subject to the terms and conditions in governing client contract.

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


Re: [S2] Problems including dojo

Posted by Musachy Barroso <mu...@gmail.com>.
Look at the output of the s:head tag which links to the dojo files, and fix
the urls to include /ext in it.

musachy

On Thu, Nov 13, 2008 at 5:36 AM, Jan Froehlich
<Ja...@infomotion.de>wrote:

> Hi there...
>
> I have an existing web application based on a servlet. As I need to
> extend it and dont want to mess around with the old code, I want to add
> struts2 capabilites and do some reengineering for the extension.
>
> My problem is, that I have registered the struts2 filter with the
> <url-pattern>/ext/*</url-pattern>
> When I try to include dojo functions in my jsp pages, I get an error
> saying djConfig undefined.
>
> I found out, that if I change the url-pattern to /* its working like
> expected - but that is not possible.
>
> Can someone give me a hint on how to solve this? I need the pattern
> /ext/*
>
> Any help apreciated!
>
> Regards
> Jan Froehlich
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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

[S2] Problems including dojo

Posted by Jan Froehlich <Ja...@infomotion.de>.
Hi there...

I have an existing web application based on a servlet. As I need to
extend it and dont want to mess around with the old code, I want to add
struts2 capabilites and do some reengineering for the extension.

My problem is, that I have registered the struts2 filter with the
<url-pattern>/ext/*</url-pattern>
When I try to include dojo functions in my jsp pages, I get an error
saying djConfig undefined.

I found out, that if I change the url-pattern to /* its working like
expected - but that is not possible.

Can someone give me a hint on how to solve this? I need the pattern
/ext/*

Any help apreciated!

Regards 
Jan Froehlich

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