Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 28 Jul 2010 21:03:43 -0000 Issue 9134

user-digest-help

2010-07-28


Author LoginPost Reply

user Digest 28 Jul 2010 21:03:43 -0000 Issue 9134

Topics (messages 207057 through 207081):

Re: REST URLs
 207057 by: mailtolouis2020-struts.yahoo.com
 207070 by: Zoran Avtarovski

Struts2 + REST - how to include/exclude properties of the model
 207058 by: mailtolouis2020-struts.yahoo.com

Re: IE7 abruptly closes with struts 2.1.7
 207059 by: satyanarayana katta

Re: Struts2 - JSF Plugin - Richfaces
 207060 by: Jyoo
 207061 by: Frans Thamura
 207075 by: Stefano Corallo

Setting up 2.2.1 in maven for testing
 207062 by: java.rgm.spamgourmet.com
 207063 by: Lukasz Lenart
 207064 by: java.rgm.spamgourmet.com
 207071 by: Lukasz Lenart

NullPointerException at struts2 LocalizedTextUtil
 207065 by: Rubén khanser

Display GregorianCalendar Objects
 207066 by: Ken
 207067 by: Reeshi Agrawal
 207068 by: Pawe³ Wielgus
 207069 by: Michal Ciasnocha
 207073 by: Reeshi Agrawal
 207074 by: Michal Ciasnocha
 207077 by: Ken

Job opportunity in Europe
 207072 by: Tim Robertson

Advice on replacing an image with fall-back?
 207076 by: java.rgm.spamgourmet.com

Reading input stream (xml)
 207078 by: Arun Kumar Boppudi

getting label from property
 207079 by: Ryan Beckes
 207080 by: Michal Ciasnocha
 207081 by: Ryan Beckes

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

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


Attachment: user_207057.ezm (zipped)
Thanks Kevin



________________________________
From: Kevin Jones <kev.r.jones@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Mon, July 26, 2010 3:05:30 PM
Subject: Re: REST URLs

I've heard back from Jeromy Evans. He's happy for me to post the code.
Unfortunately it may not be until the weekend as I'm on the road at
the moment,

Kevin

On 26 July 2010 14:11, Kevin Jones <kev.r.jones@(protected):
> There is a cached copy of the site here
>
>http://webcache.googleusercontent.com/search?q=cache:http://www.blueskyminds.com.au/url-hierarchy/
>/
> (you'll need to follow cached copies of the other links as well)
>
> I've sent Jeromy Evans an email asking if it's OK to post his code.
> If/when he replies I'll put it somewhere where it can be downloaded,
>
> Kevin
>
> On 26 July 2010 12:36, Arun Kumar Boppudi <arunkumar.boppudi@(protected):
>> http://www.blueskyminds.com.au/url-hierarchy/ is not available.
>> -- AB
>>
>>
>> On Mon, Jul 26, 2010 at 4:30 PM, Kevin Jones <kev.r.jones@(protected):
>>
>>> Yes it is.
>>>
>>> Look at the REST plugin but then you'll need some more processing.
>>>
>>> Jeromy Evans (who was/is a Struts commiter) posted an example a while ago.
>>>
>>> Look at this thread here
>>> http://www.mail-archive.com/issues@(protected)
>>>
>>> The example is supposed to be at:
>>> http://www.blueskyminds.com.au/url-hierarchy/
>>> but the link is broken at the moment.
>>>
>>> I've used the code as an example and it all seems to work.
>>>
>>> Ping me if you can't get the code and I can send it to you (it's
>>> licensed under the Apache license so it's OK to share),
>>>
>>> Kevin Jones
>>>
>>> On 26 July 2010 09:00, Arun Kumar Boppudi <arunkumar.boppudi@(protected)>
>>> wrote:
>>> > Is there anyway we can use /client/{clientId}/business/{businessId} kind
>>> of
>>> > URLs in Struts 2.0?
>>> >
>>> > -- AB
>>> >
>>>
>>>
>>>
>>> --
>>> Kevin
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>
>
>
>
> --
> Kevin
>



--
Kevin

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

Attachment: user_207070.ezm (zipped)
Another option that doesn¹t tie you down to the REST plugin is to use the
URL Rewrite Filter ( www.tuckey.org/urlrewrite/)

We¹ve been using this for a while without any issues.

Z.
>
> Is there anyway we can use /client/{clientId}/business/{businessId} kind of
> URLs in Struts 2.0?
>
> -- AB


Attachment: user_207058.ezm (zipped)
Hi,

I know in json result type we can configure something like this

<result type="json">
<param name="includeProperties">
  total,
     page,
  records,
  gridData.*,
       userdata.*
</param>
</result>

Can we do the same in rest controller using annotation?

Attachment: user_207059.ezm (zipped)
Thanks for the reply. We don't see any issues at the bak end.  The IE just closes abruptly. These r intranet apps and support only IE7 right now. We see this happening only for certain set of users.

Regards,
Satya

Sent from my iPhone

On Jul 26, 2010, at 6:49 AM, Martin Gainty <mgainty@(protected):

>
> IE options:
>
> enable script debugging
> display notification about every script error
>
>
> before the error is manifested append debug=browser on your Action e.g. index.action?query=browser
>
> http://struts.apache.org/2.1.8.1/docs/debugging-struts.html
>
>
>
> strip the jsp down to basics (a form) and add in one component at a time and observe behavior
>
> <%@(protected)" %>
> <html>
>   <head><title>Title</title></head>
>
> <body>
>
>  <s:form action="YourAction">
>          <s:submit value="submit"/>
>   </s:form>
>
> </body>
>
> </html>
>
>
>
> add JSTL EL
>
> do you see error?
>
>
> add OGNL expressions
> do you see error?
>
>
>
> do you see error with other browsers??
> 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.
>
>
>
>
>
>> Subject: IE7 abruptly closes with struts 2.1.7
>> From: saty.prasad@(protected)
>> Date: Tue, 20 Jul 2010 09:39:30 -0700
>> To: user@(protected)
>>
>> Hi,
>>
>> We are using struts 2.1.7 with dojos for our application. Sometimes the Ie7 abruptly closes leaving no traces what so ever. Has any one faced this issue earlier?
>>
>>
>> Sent from my iPhone
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>                
> _________________________________________________________________
> The New Busy is not the old busy. Search, chat and e-mail from your inbox.
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3


Attachment: user_207060.ezm (zipped)

Hi Stefano Corallo-2

Can u able to work with richfaces now in your appilcation ..If yes please
post the procedure here .How u have configured ....
thnks


--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_207061.ezm (zipped)
That will be awesome that componen can mix with action
------Original Message------
From: Jyoo
To: user@(protected)
ReplyTo: Struts Users Mailing List
Subject: RE: Struts2 - JSF Plugin - Richfaces
Sent: Jul 27, 2010 12:53


Hi Stefano Corallo-2

Can u able to work with richfaces now in your appilcation ..If yes please
post the procedure here .How u have configured ....
thnks


--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)



(m)


Attachment: user_207075.ezm (zipped)
Hi,

i've simply followed this:

http://struts.apache.org/2.x/docs/jsf-plugin.html

and in the struts.xml:


<package name="jsf" extends="jsf-default" namespace="/jsf">

   <result-types>
      <result-type name="jsf"
class="org.apache.struts2.jsf.FacesResult" />
   </result-types>

  <interceptors>
   <interceptor-stack name="jsfFullStack">
    <interceptor-ref name="params" />
    <interceptor-ref name="basicStack"/>
    <interceptor-ref name="jsfStack"/>
   </interceptor-stack>
  </interceptors>

  <default-interceptor-ref name="jsfFullStack"/>

</package>

<package name="jsfTest" extends="jsf">
  <action name="hello" class="test.HelloWorldAction"
method="execute">
    <result name="success" type="jsf"/>  
  </action>
 
</package>


Il giorno mar, 27/07/2010 alle 05.55 +0000, Frans Thamura ha scritto:
> That will be awesome that componen can mix with action
> ------Original Message------
> From: Jyoo
> To: user@(protected)
> ReplyTo: Struts Users Mailing List
> Subject: RE: Struts2 - JSF Plugin - Richfaces
> Sent: Jul 27, 2010 12:53
>
>
> Hi Stefano Corallo-2
>
> Can u able to work with richfaces now in your appilcation ..If yes please
> post the procedure here .How u have configured ....
> thnks
>
>




Attachment: user_207062.ezm (zipped)
I'd like to test the Sitemesh / FreeMarker "full integration" configuration available in Struts 2.2.1, detailed on this page:
http://struts.apache.org/2.x/docs/sitemesh-plugin.html

BUT I'm new to using maven and can't seem to figure out how to modify my pom.xml such that maven downloads the pre-release build of struts2-core-2.2.1.jar on its own from the staging repository. I've added a pluginRepository section (from the 2.2.1 VOTE email), but this is insufficient / incomplete.

Any help is appreciated.

Sincerely,

-rgm

------
My current pom.xml (does not work):

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example.rss</groupId>
  <artifactId>Muskox</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>Muskox Hello World</name>
  <build>
    <finalName>Muskox</finalName>
  </build>
  <dependencies>
    <dependency>
       <groupId>org.apache.struts</groupId>
       <artifactId>struts2-core</artifactId>
       <version>2.2.1</version>
    </dependency>
    <dependency>
       <groupId>org.freemarker</groupId>
       <artifactId>freemarker</artifactId>
       <version>2.3.16</version>
    </dependency>
    <dependency>
       <groupId>org.apache.struts</groupId>
       <artifactId>struts2-sitemesh-plugin</artifactId>
       <version>2.1.8</version>
    </dependency>
    <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
       <version>1.2.14</version>
    </dependency>
  </dependencies>
   <pluginRepositories>
  <pluginRepository>
   <id>orgapachestruts-014</id>
   <url>https://repository.apache.org/content/repositories/orgapachestruts-014</url>
  </pluginRepository>
</pluginRepositories>
</project>


Attachment: user_207063.ezm (zipped)
Hi,

You must define it in repository section of your pom ->
http://maven.apache.org/pom.html#Repositories

<repositories>
  <repository>
    <id>struts-staging</id>
    <url>https://repository.apache.org/content/repositories/orgapachestruts-014</url>
    <layout>default</layout>
 </repository>
</repositories>


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Kapituła Javarsovia 2010 http://javarsovia.pl


Attachment: user_207064.ezm (zipped)
Thank you Łukasz, I'm able to move forward now.  I should point out that the Sitemesh Plugin page (linked below) lacks information about decorators.xml, which DOES seem to be required in order for the plugin to function. The decorators.xml file can simply contain "<decorators />" but it seems that it must exist in WEB-INF. Furthermore, examples of a freemarker decorator have been removed since the 2.0.14 documentation, and there is no discussion of or link to documentation about DecoratorMappers.

Other problems include:
* The section titled "Velocity" correctly references the VelocityDecoratorServlet, but contains copy/paste information from the Freemarker section -- it has incorrect servlet-mapping, servlet-name, and url-pattern examples.
* That section appears to be duplicated information anyway -- farther down the page similar but slightly different web.xml configurations are pasted in
* "... please refer to WW-3296 for me info" <-- should be "more", or relevant data should be imported into plugin page document instead of referencing the bug.

In general, the Sitemesh Plugin page could use some love to make it more useful to new implementors.
Thank you for taking the time to consider improving the docs, I know it's not as sexy as coding.

-rgm


On Jul 27, 2010, at 8:13 AM, java.rgm@(protected):

> I'd like to test the Sitemesh / FreeMarker "full integration" configuration available in Struts 2.2.1, detailed on this page:
> http://struts.apache.org/2.x/docs/sitemesh-plugin.html
>
> BUT I'm new to using maven and can't seem to figure out how to modify my pom.xml such that maven downloads the pre-release build of struts2-core-2.2.1.jar on its own from the staging repository. I've added a pluginRepository section (from the 2.2.1 VOTE email), but this is insufficient / incomplete.
>
> Any help is appreciated.
>
> Sincerely,
>
> -rgm
>
> ------
> My current pom.xml (does not work):
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.example.rss</groupId>
>   <artifactId>Muskox</artifactId>
>   <packaging>war</packaging>
>   <version>0.0.1-SNAPSHOT</version>
>   <name>Muskox Hello World</name>
>   <build>
>     <finalName>Muskox</finalName>
>   </build>
>   <dependencies>
>     <dependency>
>        <groupId>org.apache.struts</groupId>
>        <artifactId>struts2-core</artifactId>
>        <version>2.2.1</version>
>     </dependency>
>     <dependency>
>        <groupId>org.freemarker</groupId>
>        <artifactId>freemarker</artifactId>
>        <version>2.3.16</version>
>     </dependency>
>     <dependency>
>        <groupId>org.apache.struts</groupId>
>        <artifactId>struts2-sitemesh-plugin</artifactId>
>        <version>2.1.8</version>
>     </dependency>
>     <dependency>
>        <groupId>log4j</groupId>
>        <artifactId>log4j</artifactId>
>        <version>1.2.14</version>
>     </dependency>
>   </dependencies>
>    <pluginRepositories>
>   <pluginRepository>
>    <id>orgapachestruts-014</id>
>    <url>https://repository.apache.org/content/repositories/orgapachestruts-014</url>
>   </pluginRepository>
> </pluginRepositories>
> </project>




Attachment: user_207071.ezm (zipped)
Thanks for your comments! Please register a ticket and I try to put
some love with the docs ;-)


Kind regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Kapituła Javarsovia 2010 http://javarsovia.pl


Attachment: user_207065.ezm (zipped)
Hi,

I'm having this strange error.

When I'm trying to read a property from my properties file with the
"getText" @ ActionSupport method I get this NPE and this message:
DEBUG com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor - Error
calling method through OGNL: object:
[org.gestor.actions.proyecto.ProyectoCrearAction@(protected)]
args: [[boton.cancelar]]

Also when I put this same key at the "key" attribute of one struts2 submit
button I get nothing.

However using struts2 labels with that same "key" with the same value that
was failing now it gets the value.

I hope someone can help me.

Thank you.

Attachment: user_207066.ezm (zipped)

This seems like it should be beyond easy yet I still find my self
asking...

I my POJO has several GregorianCalendar objects.

In my JSP what is the best way to display a simple (year, month, day)
format?
Use Java in the JSP it self? Is there a good struts 2 tag for this... I
think if the
field were editable it would be distracting.

It seems to be a display issue but I could go back to the POJO and put
formatting
logic there...

Anyways open to suggestions.

Attachment: user_207067.ezm (zipped)
Same problem with me...
I want (through Struts 2 tags), a way to display date as three adjacent
(side-by-side) drop-down menus, one each for date,month and year. Normally
what will happen is: the three drop-down menus will be displayed in three
separate consecutive rows in the HTML table generated in Struts 2. But I
want them to be present in a single row in the displayed HTML table. Do I
need to do some modification in the freeMarker templates' .ftl files? Or is
there another very simple thing that I am missing?
I know I am asking a very simp;e thing, but its bugging me from quite some
time...

Attachment: user_207068.ezm (zipped)
Hi all,
i do it like that:
in my POJO GregorianCalendar field,
on my jsp text field + jquery calendar.
If You want to create date in some kind of predefined format
You can use Conventer for GregorianCalendar for your app.


Best greetings,
Paweł Wielgus.

2010/7/27 Reeshi Agrawal <rushiagrawal@(protected)>:
> Same problem with me...
> I want (through Struts 2 tags), a way to display date as three adjacent
> (side-by-side) drop-down menus, one each for date,month and year. Normally
> what will happen is: the three drop-down menus will be displayed in three
> separate consecutive rows in the HTML table generated in Struts 2. But I
> want them to be present in a single row in the displayed HTML table. Do I
> need to do some modification in the freeMarker templates' .ftl files? Or is
> there another very simple thing that I am missing?
> I know I am asking a very simp;e thing, but its bugging me from quite some
> time...
>


Attachment: user_207069.ezm (zipped)
Why don't use Struts tag s:date for date formatting?

in Action:

public GregorianCalendar getMyDate() {
    return new GregorianCalendar();
}

in jsp:

<s:date name="myDate" format="d. M. yyyy HH:mm" />

Michal

> Hi all,
> i do it like that:
> in my POJO GregorianCalendar field,
> on my jsp text field + jquery calendar.
> If You want to create date in some kind of predefined format
> You can use Conventer for GregorianCalendar for your app.
>
>
> Best greetings,
> Paweł Wielgus.
>
> 2010/7/27 Reeshi Agrawal<rushiagrawal@(protected)>:
>> Same problem with me...
>> I want (through Struts 2 tags), a way to display date as three adjacent
>> (side-by-side) drop-down menus, one each for date,month and year. Normally
>> what will happen is: the three drop-down menus will be displayed in three
>> separate consecutive rows in the HTML table generated in Struts 2. But I
>> want them to be present in a single row in the displayed HTML table. Do I
>> need to do some modification in the freeMarker templates' .ftl files? Or is
>> there another very simple thing that I am missing?
>> I know I am asking a very simp;e thing, but its bugging me from quite some
>> time...
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment: user_207073.ezm (zipped)
Michal,
I wanted the user to input his birth-date. Displaying the current date will
be of no use for it.

Attachment: user_207074.ezm (zipped)
In that case you must use own converter like this:

public class DateTimeConverter extends StrutsTypeConverter {

   @Override
   public Object convertFromString(Map context, String[] values,
Class toClass) {
      try {
          return DateUtil.getConvertedDate(values[0],
DateUtil.DATE_TIME);
      } catch (TypeConversionException tce) {
          log.error("Exception while parsing date.", tce);
      }
      return null;
   }
}

Method getConvertedDate() just parse inserted date as string by user.

Reeshi Agrawal wrote on 28.7.2010 15:05:
> Michal,
> I wanted the user to input his birth-date. Displaying the current date will
> be of no use for it.
>

Attachment: user_207077.ezm (zipped)
On Tue, 2010-07-27 at 21:45 +0200, Michal Ciasnocha wrote:

> Why don't use Struts tag s:date for date formatting?
>
> in Action:
>
> public GregorianCalendar getMyDate() {
>     return new GregorianCalendar();
> }
>
> in jsp:
>
> <s:date name="myDate" format="d. M. yyyy HH:mm" />
>
> Michal
>
> > Hi all,
> > i do it like that:
> > in my POJO GregorianCalendar field,
> > on my jsp text field + jquery calendar.
> > If You want to create date in some kind of predefined format
> > You can use Conventer for GregorianCalendar for your app.

Ah, too easy... I had been using DateTimePicker and confused the two.

Well in my efforts to output the GregorianCalendar object in OGNL I had
troubles,
although it is clearly not the best way (clearly to me now that is)...
Perhaps
someone can explain:
1) Casting in OGNL, and 2) Referencing static field definitions in
OGNL...

For instance in my efforts to get the date out I wrote:
<s:property value=" '' + courseStartDate.get(1) + '-' +
{courseStartDate.get(2) + 1} + '-' + courseStartDate.get(5)"/>

Where:
courseStartDate.get(1) aught to be written
courseStartDate.get(Calendar.YEAR),
courseStartDate.get(2) aught to be written courseStartDate.get(MONTH)
courseStartDate.get(5) aught to be written
courseStartDate.get(Calendar.DATE),
maybe it works it just didn't seem to for me...

Then I had difficulties because of automatic type conversion...
The Month is 0 based so I need to add 1 to the date, so I tried...
(courseStartDate.get(2) + 1) but I think that resulted in the string "1"
being appended to the end of everything...
the closest I could get was {courseStartDate.get(2) + 1} and that prints
the correct number but inside square brackets.

So after all that Michal pointed out the obvious and I threw all this
out the window and just used the date tag but I'd still like to address
these issues.




Attachment: user_207072.ezm (zipped)
Hi all,

Disclosure: I am not a recruiter, but looking to increase a
development team that I lead. I sincerely apologize if this message
is against mailing list etiquette; I have not seen any guidelines
forbidding this.

We are looking to expand the development team based in Copenhagen,
Denmark. We run and operate an indexing system that provides access
to biodiversity information, and specifically 100s millions of point
based observations of species occurrence documented in the past
century. Our live system is outgrowing a MySQL database, and runs
using Spring and SpringMVC. Over the next 16 months we will rework
the whole system, including custom reporting, custom maps and other
visualizations, real time search indexes, reducing latency, quality
control integration, custom vocabulary work etc. We have recently
been developing using Struts2, and will be reworking our Portal
backend (PostGIS, Hadoop, Hive, HBase) and the front end with Struts2.
If you are familiar with these technologies, and the thought of some
time working in Europe appeals to you, then we'd love to hear from
you.

Guidelines for applications are on the advert: http://tinyurl.com/gbif-dev-job
(GBIF is a multi-government initiative hosted in Denmark and as such
has certain visa privileges easing international recruitment)

Thanks,
Tim


Attachment: user_207076.ezm (zipped)
I'm suffering from option overload and need advice on how best to accomplish loading resources based on the User's current "skin." This would be something the user could set through an Action, and would be stored on the HttpSession.

I'd like to have one set of templates and page resources normally, but sometimes override them with files from an alternate location, IF a "skin" is in effect AND a replacement is available. A skin is simply a directory name, which contains a set of resources that should take precedence over the "normal" ones.

Consider the following webapp layout:

WEB-INF/decorators/default.ftl
index.ftl
css/default.css
images/header.png
WEB-INF/skins/NewSkin/decorators/default.ftl
WEB-INF/skins/NewSkin/css/default.css
WEB-INF/skins/NewSkin/images/header.png

If "index.ftl" has a header logo thanks to the default SiteMesh decorator, but if the user indicates that they want to change their "skin" to "NewSkin" how best to "transparently" look for resources in an alternate location and fall-back to the default location if they don't exist? Currently, references to the header in the template look like:

 <img src="${base}/images/header.png" />

I'd like to avoid putting branches and skin logic in the templates themselves -- is there a lower layer, or a particular strategy that I should look into?

I just don't know which of these avenues holds most promise:

* A custom Struts2 theme
* Wrapping every reference to any image in a "getFileLocation()" method call (perhaps from a BaseAction) that is itself aware of the current skin context
* Using an OGNL expression in the FreeMarker result location parameter (good for templates, bad for things like images and css w/o more code in template)
* Writing a servlet to serve up all .js, .css, and image files -- it would look for existence of the file in the skin, and if not found would fall-back and return the normal one
* Somehow doing it at the SiteMesh layer -- perhaps a DecoratorMapper
* Using my own JSP tag library within the FreeMarker templates to reference external resources

Any guidance or ideas are appreciated!

-rgm





Attachment: user_207078.ezm (zipped)
If we send XML content in the POST/PUT request to Struts action controller,
how to read this content in the Action class?

-- AB

Attachment: user_207079.ezm (zipped)
Hi All,

I'm working my way through properties and I'm kind of stuck. I have a
properties file (package.properties) with a "message" entry...

Index.message= Color

... I am able to pull this message via the s:text tag, so I know it's
available in the value stack, but when I try to pull the same message for
the select label below, it does not work. I've also tried %{message} and
%{getText('message')}.

Thanks,
Ryan


<%@(protected)"%>
<%@(protected)"%>
<%@(protected)" %>
<table class="w100p" border="1">
<tr>
  <td>
   <s:text name="message"/>
  </td>
  <td class="alR">
   <s:form class="mauto alR" name="change_color" action="/index.action"
method="GET" javascriptTooltip="true">
      <s:select
        class="mauto"
        tooltip="Choose Your Color"
        label="message"
        list="#{'b':'Blue', 'r':'Red'}"
        name="request_color"
        emptyOption="false"
        value="color"
        onchange="javascript: document.change_color.submit();"
      />
   </s:form>
  </td>
</tr>
</table>

Attachment: user_207080.ezm (zipped)
Hi Ryan,

for getting translated text as label of select tag (and other tags) use
"key" attribute. Usage is same as <s:s text name="..." />.


Best regards,

Michal

Ryan Beckes wrote on 28.7.2010 20:16:
> Hi All,
>
> I'm working my way through properties and I'm kind of stuck. I have a
> properties file (package.properties) with a "message" entry...
>
> Index.message= Color
>
> ... I am able to pull this message via the s:text tag, so I know it's
> available in the value stack, but when I try to pull the same message for
> the select label below, it does not work. I've also tried %{message} and
> %{getText('message')}.
>
> Thanks,
> Ryan
>
>
> <%@(protected)"%>
> <%@(protected)"%>
> <%@(protected)" %>
> <table class="w100p" border="1">
>   <tr>
>    <td>
>     <s:text name="message"/>
>    </td>
>    <td class="alR">
>     <s:form class="mauto alR" name="change_color" action="/index.action"
> method="GET" javascriptTooltip="true">
>        <s:select
>          class="mauto"
>          tooltip="Choose Your Color"
>          label="message"
>          list="#{'b':'Blue', 'r':'Red'}"
>          name="request_color"
>          emptyOption="false"
>          value="color"
>          onchange="javascript: document.change_color.submit();"
>        />
>     </s:form>
>    </td>
>   </tr>
> </table>
>

Attachment: user_207081.ezm (zipped)
Thanks!

On Wed, Jul 28, 2010 at 1:40 PM, Michal Ciasnocha <mc@(protected):

> Hi Ryan,
>
> for getting translated text as label of select tag (and other tags) use
> "key" attribute. Usage is same as <s:s text name="..." />.
>
>
> Best regards,
>
> Michal
>
> Ryan Beckes wrote on 28.7.2010 20:16:
>
> Hi All,
>>
>> I'm working my way through properties and I'm kind of stuck. I have a
>> properties file (package.properties) with a "message" entry...
>>
>> Index.message= Color
>>
>> ... I am able to pull this message via the s:text tag, so I know it's
>> available in the value stack, but when I try to pull the same message for
>> the select label below, it does not work. I've also tried %{message} and
>> %{getText('message')}.
>>
>> Thanks,
>> Ryan
>>
>>
>> <%@(protected)"%>
>> <%@(protected)"%>
>> <%@(protected)" %>
>> <table class="w100p" border="1">
>>  <tr>
>>   <td>
>>     <s:text name="message"/>
>>   </td>
>>   <td class="alR">
>>     <s:form class="mauto alR" name="change_color" action="/index.action"
>> method="GET" javascriptTooltip="true">
>>       <s:select
>>         class="mauto"
>>         tooltip="Choose Your Color"
>>         label="message"
>>         list="#{'b':'Blue', 'r':'Red'}"
>>         name="request_color"
>>         emptyOption="false"
>>         value="color"
>>         onchange="javascript: document.change_color.submit();"
>>       />
>>     </s:form>
>>   </td>
>>  </tr>
>> </table>
>>
>>
©2008 gg3721.com - Jax Systems, LLC, U.S.A.