Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 10 Apr 2008 13:29:37 -0000 Issue 7972

user-digest-help

2008-04-10


Author LoginPost Reply

user Digest 10 Apr 2008 13:29:37 -0000 Issue 7972

Topics (messages 185220 through 185249):

i18n Tags in FreeMarker Decorator for SiteMesh
 185220 by: mraible
 185221 by: Jeromy Evans
 185224 by: mraible
 185225 by: Jeromy Evans

Most popular classes to be used in Struts
 185222 by: Sam Wun
 185229 by: Lukasz Lenart
 185230 by: Lukasz Lenart
 185233 by: Antonio Petrelli

S2 Textfield tag date formatting
 185223 by: Steve Akins

How to open a page in new window with <s:a> or <s:url> tag?
 185226 by: Mohiit
 185237 by: Laurie Harper

Using jsp tag in Value attribute of textfield tag in Struts2
 185227 by: Tauri Valor
 185232 by: Tauri Valor
 185239 by: Laurie Harper

Re: Local Host Error
 185228 by: Lukasz Lenart
 185247 by: Alberto A. Flores

Advice on dynamic form elements
 185231 by: Zoran Avtarovski
 185238 by: Laurie Harper
 185246 by: Zoran Avtarovski

retrotranslating struts 2.0.11 not working
 185234 by: Paula Estrella
 185235 by: Antonio Petrelli
 185236 by: Al Sutton
 185243 by: Paula Estrella
 185245 by: Antonio Petrelli

Again: question to interceptors
 185240 by: Peter Theissen
 185242 by: Ralf Fischer

How to use "Autocompleter" like GMail style.
 185241 by: Joey

Problem when upgrading to Struts 2.1
 185244 by: oscar perez

Looking for documentation for Table Tags plugin
 185248 by: Lars Krog

how to handle an action with parameter?
 185249 by: Danieleippoliti\.libero\.it

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_185220.ezm (zipped)

I'm using 2.1.1-SNAPSHOT of the sitemesh and rest plugins.
FreeMarker/SiteMesh is working fine. However, I'm unable to use i18n tags in
my decorator. In src/main/resources/com/company/app/package.properties, I
have:

webapp.name=Foo
webapp.tagline=Bar

In my decorators/default.ftl, I have:

[@(protected)"/]

And it renders:

webapp.name

Any idea why my Struts FreeMarker tag isn't being processed? I have the
following in my web.xml:

  <filter-mapping>
    <filter-name>struts-cleanup</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <filter-mapping>
    <filter-name>sitemesh</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <filter-mapping>
    <filter-name>struts</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

Thanks,

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


Attachment: user_185221.ezm (zipped)
Hi Matt,

is it only the @s.text tag that isn't working? eg. is @s.property working?

I've suspected there's a problem with the text tag and i18n tag not
finding some resource bundles in the S2.1.1 branch but haven't had a
chance to investigate. There's several related issues in JIRA and I
recall something specifically about package-level properties. I may
have an opportunity to investigate later today. Does it find resources
in your action-properties or global properties?

cheers,
Jeromy Evans

mraible wrote:
> I'm using 2.1.1-SNAPSHOT of the sitemesh and rest plugins.
> FreeMarker/SiteMesh is working fine. However, I'm unable to use i18n tags in
> my decorator. In src/main/resources/com/company/app/package.properties, I
> have:
>
> webapp.name=Foo
> webapp.tagline=Bar
>
> In my decorators/default.ftl, I have:
>
> [@(protected)"/]
>
> And it renders:
>
> webapp.name
>
> Any idea why my Struts FreeMarker tag isn't being processed? I have the
> following in my web.xml:
>
>   <filter-mapping>
>      <filter-name>struts-cleanup</filter-name>
>      <url-pattern>/*</url-pattern>
>   </filter-mapping>
>
>   <filter-mapping>
>      <filter-name>sitemesh</filter-name>
>      <url-pattern>/*</url-pattern>
>   </filter-mapping>
>
>   <filter-mapping>
>      <filter-name>struts</filter-name>
>      <url-pattern>/*</url-pattern>
>   </filter-mapping>
>
> Thanks,
>
> Matt
>  


Attachment: user_185224.ezm (zipped)

I tried [@(protected)
either. I don't have a struts.xml or struts.properties in my project. I
tried putting the i18n bundle in all packages using it at the Action level
(ActionName.properties), but that didn't work either. Creating a
src/main/resources/struts.properties with the following in it is the only
thing that seems to work.

struts.custom.i18n.resources=messages

And then putting my keys in src/main/resources/messages.properties.

AFAICT, i18n bundles at the action/package level seems to be completely
broken in 2.1.1.

Matt


Jeromy Evans - Blue Sky Minds wrote:
>
> Hi Matt,
>
> is it only the @s.text tag that isn't working? eg. is @s.property
> working?
>
> I've suspected there's a problem with the text tag and i18n tag not
> finding some resource bundles in the S2.1.1 branch but haven't had a
> chance to investigate. There's several related issues in JIRA and I
> recall something specifically about package-level properties. I may
> have an opportunity to investigate later today. Does it find resources
> in your action-properties or global properties?
>
> cheers,
> Jeromy Evans
>
> mraible wrote:
>> I'm using 2.1.1-SNAPSHOT of the sitemesh and rest plugins.
>> FreeMarker/SiteMesh is working fine. However, I'm unable to use i18n tags
>> in
>> my decorator. In src/main/resources/com/company/app/package.properties, I
>> have:
>>
>> webapp.name=Foo
>> webapp.tagline=Bar
>>
>> In my decorators/default.ftl, I have:
>>
>> [@(protected)"/]
>>
>> And it renders:
>>
>> webapp.name
>>
>> Any idea why my Struts FreeMarker tag isn't being processed? I have the
>> following in my web.xml:
>>
>>   <filter-mapping>
>>      <filter-name>struts-cleanup</filter-name>
>>      <url-pattern>/*</url-pattern>
>>   </filter-mapping>
>>
>>   <filter-mapping>
>>      <filter-name>sitemesh</filter-name>
>>      <url-pattern>/*</url-pattern>
>>   </filter-mapping>
>>
>>   <filter-mapping>
>>      <filter-name>struts</filter-name>
>>      <url-pattern>/*</url-pattern>
>>   </filter-mapping>
>>
>> Thanks,
>>
>> Matt
>>  
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

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


Attachment: user_185225.ezm (zipped)
mraible wrote:
> I tried [@(protected)')"/]
I've already found that in 2.0.x this OGNL expression executed
getText(String) but in 2.1.x it only matches the method "text(String)".
I'm not sure when that changed in the OGNL implementation, but the new
form seems correct as it's method call not a property.
I've already replaced one occurrence of "text('key')" with
"getText('key')" in the code but there's probably others. That's one of
the consequences of allowing loosely typed expressions to creep into code.

I'll definitely look further into this today as its been affecting me
for a while too.


Attachment: user_185222.ezm (zipped)
Hi,

What are the most popular classes to be used in Struts?

Thanks



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Attachment: user_185229.ezm (zipped)
Hi,

Some home work? ;-)

> What are the most popular classes to be used in Struts?

ActionSupport?


Regards
--
Lukasz

http://www.linkedin.com/in/lukaszlenart

Attachment: user_185230.ezm (zipped)
> ActionSupport?

Ugh... sorry this came from xwork ;-)


Regards
--
Lukasz

http://www.linkedin.com/in/lukaszlenart

Attachment: user_185233.ezm (zipped)
2008/4/10, Lukasz Lenart <lukasz.lenart@(protected)>:
>
> Some home work? ;-)



Nope, just a phone interview :-D

Antonio

Attachment: user_185223.ezm (zipped)
I'm trying to use a textfield tag for date input. I need to format this in
the form dd/MM/yyyy HH:mm:ss

The teaxtfield tag formats the date to a Locale based format
DateFormat.SHORT via XWorkBasicConverter. For my locale this turns out to
be dd/MM/yy. This is not the format I want.

<s:textfield cssClass="field" key="filter.dateTimeStart"
name="filter.dateTimeStart"/>

DateTimePicker wont allow you to apply a style class to the input field so
it wont format. Bug has been reported in Struts JIRA (WW-1778) and a fix
made. Need to wait for Struts 2.1 before this will work so I can't use
this.

Using the value parameter and a date tag won't work because this overwrites
the value entered. If the user enters a value that can't be converted to a
date it isn't re-displayed, the field is displayed empty.

<s:textfield cssClass="field" key="filter.dateTimeStart"
name="filter.dateTimeStart">
<s:param name="value">
  <s:date name="filter.dateTimeStart" format="dd/MM/yyyy HH:mm:ss" />
</s:param>
</s:textfield>

In the S2 guide for Type Conversion (
http://struts.apache.org/2.x/docs/type-conversion.html) it has a note saying
not to use Type Conversion for dates.

Does anyone know of a way to do this?


Thanks in advance.

Attachment: user_185226.ezm (zipped)

I am using Struts 2. I want to open the page in the new window when I click
on an icon. I am using <s:a> tag and giving action by <s:url> tag.
i.e., <s:url id='abc' action='xyz'>,/s:url>
    <s:a href='%{abc}'></s:a>

This way it is opening an action in same page. I want it in the new window
like in HTML tag we can do it by                 link .
What is the way in struts 2 for this..?
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_185237.ezm (zipped)
Mohiit wrote:
> I am using Struts 2. I want to open the page in the new window when I click
> on an icon. I am using <s:a> tag and giving action by <s:url> tag.
> i.e., <s:url id='abc' action='xyz'>,/s:url>
>     <s:a href='%{abc}'></s:a>
>
> This way it is opening an action in same page. I want it in the new window
> like in HTML tag we can do it by                 link .
> What is the way in struts 2 for this..?

Struts 2's s:a tag doesn't support this. The solution is to use a
combination of s:url and a vanilla HTML anchor tag:

 <s:url id='abc' ...
 <a href='${abc}' target="..." ...

HTH,

L.


Attachment: user_185227.ezm (zipped)

Hi

Is there a way to include value for textfield tag in struts2 , Im trying the
following :


 <td><s:textfield name="firstName" label="*First Name" size="15"
value="<%=freshUser.getFirstName() %>"/></td>


But I get tld error..

Please let me know how I could use jsp tag in the textfield tag, or let me
know an alternative...

Thanks in Advance,
Tauri.
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_185232.ezm (zipped)

I get the following error :

According to TLD or attribute directive in tag file, attribute value does
not accept any expressions

I could get the value using html tag '<input type=text..value=<%= ...%>>'

Thanks,
Tauri.




Tauri Valor wrote:
>
> Hi
>
> Is there a way to include value for textfield tag in struts2 , Im trying
> the following :
>
>
>  <td><s:textfield name="firstName" label="*First Name" size="15"
> value="<%=freshUser.getFirstName() %>"/></td>
>
>
> But I get tld error..
>
> Please let me know how I could use jsp tag in the textfield tag, or let me
> know an alternative...
>
> Thanks in Advance,
> Tauri.
>

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


Attachment: user_185239.ezm (zipped)
You need to use OGNL expression rather than JSP RT expressions:

http://struts.apache.org/2.0.11.1/docs/tag-syntax.html

though generally, just the name= is enough unless you need the value to
come from one place but get saved somewhere else on submit.

L.

Tauri Valor wrote:
> I get the following error :
>
> According to TLD or attribute directive in tag file, attribute value does
> not accept any expressions
>
> I could get the value using html tag '<input type=text..value=<%= ...%>>'
>
> Thanks,
> Tauri.
>
>
>
>
> Tauri Valor wrote:
>> Hi
>>
>> Is there a way to include value for textfield tag in struts2 , Im trying
>> the following :
>>
>>
>>  <td><s:textfield name="firstName" label="*First Name" size="15"
>> value="<%=freshUser.getFirstName() %>"/></td>
>>
>>
>> But I get tld error..
>>
>> Please let me know how I could use jsp tag in the textfield tag, or let me
>> know an alternative...
>>
>> Thanks in Advance,
>> Tauri.
>>
>


Attachment: user_185228.ezm (zipped)
> Hello. To preface I am very new to using Apache. I am attempting to
> experiment locally, however I cannot connect to local host nor the
> 127.0.0.1 directly. I am looking to try and get the "IT works!" Apache

Are you using Skype? By default, Skype block port 80 and 443, disable
such port in Skype or change the default port for Apache.

You can also use netstat -b from command prompt to see all programs
with opened ports.


Regards
--
Lukasz

http://www.linkedin.com/in/lukaszlenart

Attachment: user_185247.ezm (zipped)
Also, note that if you have IIS running, you would need to change the
listening port (on either IIS or Apache).

Lukasz Lenart wrote:
>> Hello. To preface I am very new to using Apache. I am attempting to
>> experiment locally, however I cannot connect to local host nor the
>> 127.0.0.1 directly. I am looking to try and get the "IT works!" Apache
>
> Are you using Skype? By default, Skype block port 80 and 443, disable
> such port in Skype or change the default port for Apache.
>
> You can also use netstat -b from command prompt to see all programs
> with opened ports.
>
>
> Regards

--

Alberto A. Flores
http://www.linkedin.com/in/aflores


Attachment: user_185231.ezm (zipped)
Hi,

We porting/upgrading a relatively simple survey tool over to struts2 from an
old php version.

The tool manages questions which can one of a fixed type (radio, drop,
checkbox, text) and then persists responses to DB.
Where I need some advice is how to implement the struts 2 display mechanism.

I figure there are two options:

1. Write a custom tag which takes the question as an attribute. Something
like <s:question value=²%{question}² />

2. I could have a small jsp fragment that I would include to render the
appropriate html.

I figured I¹d do something like :

<s:iterator value=²questions² id=²question²>
<s:push value=²%{question}²>
  <s:include value=²pagefragment.jspf²/>
</s:push>
</s:iterator>

And pagefragment.jspf would have some logic and use the appropriate form
tags to render the HTML.

I was looking for some input into what people think.


Z.


Attachment: user_185238.ezm (zipped)
Zoran Avtarovski wrote:
> Hi,
>
> We porting/upgrading a relatively simple survey tool over to struts2 from an
> old php version.
>
> The tool manages questions which can one of a fixed type (radio, drop,
> checkbox, text) and then persists responses to DB.
> Where I need some advice is how to implement the struts 2 display mechanism..
>
> I figure there are two options:
>
> 1. Write a custom tag which takes the question as an attribute. Something
> like <s:question value=²%{question}² />

Well, it wouldn't be s:question unless you're planning on modifying the
Struts taglib ;=) but a custom tag would be one way to do this. Using a
.tag file might be the easiest, depending how complex your rendering
logic is.

> 2. I could have a small jsp fragment that I would include to render the
> appropriate html.
>
> I figured I¹d do something like :
>
> <s:iterator value=²questions² id=²question²>
> <s:push value=²%{question}²>
>   <s:include value=²pagefragment.jspf²/>
> </s:push>
> </s:iterator>

The tag-based solution is obviously more concise to use, although the
s:push is unnecessary here (s:iterator pushes the value automatically).

> And pagefragment.jspf would have some logic and use the appropriate form
> tags to render the HTML.

If you can express what you want to do in a JSP, it should be trivial to
do it in a .tag file, which would give you the more concise usage.
Otherwise, a custom tag may be worth it.

L.


Attachment: user_185246.ezm (zipped)
Thanks Laurie,

I actually thought of a tag file but thought it might be the lazy way out.
We actually use them extensively for dropping in html components.

I feel a lot better now.

Thanks

Z.
>
> Zoran Avtarovski wrote:
>> > Hi,
>> >
>> > We porting/upgrading a relatively simple survey tool over to struts2 from
>> an
>> > old php version.
>> >
>> > The tool manages questions which can one of a fixed type (radio, drop,
>> > checkbox, text) and then persists responses to DB.
>> > Where I need some advice is how to implement the struts 2 display
>> mechanism..
>> >
>> > I figure there are two options:
>> >
>> > 1. Write a custom tag which takes the question as an attribute. Something
>> > like <s:question value=²%{question}² />
>
> Well, it wouldn't be s:question unless you're planning on modifying the
> Struts taglib ;=) but a custom tag would be one way to do this. Using a
> .tag file might be the easiest, depending how complex your rendering
> logic is.
>
>> > 2. I could have a small jsp fragment that I would include to render the
>> > appropriate html.
>> >
>> > I figured I¹d do something like :
>> >
>> > <s:iterator value=²questions² id=²question²>
>> > <s:push value=²%{question}²>
>> >   <s:include value=²pagefragment.jspf²/>
>> > </s:push>
>> > </s:iterator>
>
> The tag-based solution is obviously more concise to use, although the
> s:push is unnecessary here (s:iterator pushes the value automatically).
>
>> > And pagefragment.jspf would have some logic and use the appropriate form
>> > tags to render the HTML.
>
> If you can express what you want to do in a JSP, it should be trivial to
> do it in a .tag file, which would give you the more concise usage.
> Otherwise, a custom tag may be worth it.
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>



Attachment: user_185234.ezm (zipped)
Hello, We have a small application developed with struts2 for uploading
files and returning the results of doing something with the files and we
are trying to run struts2 with java 1.4.2 but it is not working after
many attempts to remove the filter start error; could you please give us
some hints?
thanks a lot and we're sorry if someone already asked this.
Paula

the working environment is: tomcat 5.0.30, jdk 1.4.2, struts 2.0.11 on a
linux suse server; we followed the procedure to retrotranslate the
following files from struts-2.0.11-j4.zip
commons-collections-3.1
freemarker-2.3.4
spring-aop-1.2.8
spring-context-1.2.8
spring-web-1.2.8
struts2-core-2.0.1
commons-logging-1.0.4
ognl-2.6.7
spring-beans-1.2.8
spring-core-1.2.8
struts2-api-2.0.1
xwork-2.0-beta-1

except for struts2-api-2.0.1, which we couldn't find anywhere.

here's the stacktrace

StandardContext[/project]Exception starting filter struts2
java.lang.UnsupportedClassVersionError: project/FileUploadAction
(Unsupported major.minor version 49.0)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:808)
    at
java.security.SecureClassLoader.defineClass (SecureClassLoader.java:147)
    at
org.apache.catalina.loader.WebappClassLoader.findClassInternal (WebappClassLoader.java:1634)
    at
org.apache.catalina.loader.WebappClassLoader.findClass (WebappClassLoader.java:860)
    at
org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1307)
    at
org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1189)
    at
com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass (ClassLoaderUtil.java:139)
    at
com.opensymphony.xwork2.ObjectFactory.getClassInstance (ObjectFactory.java:100)
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction (XmlConfigurationProvider.java:366)
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction (XmlConfigurationProvider.java:329)
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage (XmlConfigurationProvider.java:429)
    at
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages (XmlConfigurationProvider.java:239)
    at
org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages (StrutsXmlConfigurationProvider.java:111)
    at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload (DefaultConfiguration.java:152)
    at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration (ConfigurationManager.java:52)
    at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration (Dispatcher.java:395)
    at
org.apache.struts2.dispatcher.Dispatcher.init (Dispatcher.java:452)
    at
org.apache.struts2.dispatcher.FilterDispatcher.init (FilterDispatcher.java:201)
    at
org.apache.catalina.core.ApplicationFilterConfig.getFilter (ApplicationFilterConfig.java:225)
    at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef (ApplicationFilterConfig.java:308)
    at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
    at
org.apache.catalina.core.StandardContext.filterStart (StandardContext.java:3702)
    at
org.apache.catalina.core.StandardContext.start (StandardContext.java:4329)
    at
org.apache.catalina.core.ContainerBase.addChildInternal (ContainerBase.java:823)
    at
org.apache.catalina.core.ContainerBase.addChild (ContainerBase.java:807)
    at
org.apache.catalina.core.StandardHost.addChild (StandardHost.java:595)
    at
org.apache.catalina.core.StandardHostDeployer.install (StandardHostDeployer.java:277)
    at
org.apache.catalina.core.StandardHost.install (StandardHost.java:832)
    at
org.apache.catalina.startup.HostConfig.deployDirectories (HostConfig.java:701)
    at
org.apache.catalina.startup.HostConfig.deployApps (HostConfig.java:432)
    at org.apache.catalina.startup.HostConfig.start (HostConfig.java:983)
    at
org.apache.catalina.startup.HostConfig.lifecycleEvent (HostConfig.java:349)
    at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent (LifecycleSupport.java:119)
    at
org.apache.catalina.core.ContainerBase.start (ContainerBase.java:1091)
    at
org.apache.catalina.core.StandardHost.start (StandardHost.java:789)
    at
org.apache.catalina.core.ContainerBase.start (ContainerBase.java:1083)
    at
org.apache.catalina.core.StandardEngine.start (StandardEngine.java:478)
    at
org.apache.catalina.core.StandardService.start (StandardService.java:480)
    at
org.apache.catalina.core.StandardServer.start (StandardServer.java:2313)
    at org.apache.catalina.startup.Catalina.start (Catalina.java:556)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:85)
    at
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:58)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java(Compiled
Code))
    at java.lang.reflect.Method.invoke (Method.java(Compiled Code))
    at org.apache.catalina.startup.Bootstrap.start (Bootstrap.java:287)
    at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:425)


Attachment: user_185235.ezm (zipped)
2008/4/10, Paula Estrella <Paula.Estrella@(protected)>:
>
> the working environment is: tomcat 5.0.30, jdk 1.4.2, struts 2.0.11 on a
> linux suse server; we followed the procedure to retrotranslate the
> following files from struts-2.0.11-j4.zip



The "j4" package contains already retrotranslated versions of Struts 2 and
XWork.
Moreover you want to retrotranslate struts 2.0.1 while you were using
2.0.11... Just a mess, isn't it? :-D
FYI: the latest release is 2.0.11.1
http://struts.apache.org/download.cgi#struts20111
Anyway the link to the retrotranslated release is wrong, replace "j4" with
"backport".

Antonio

Attachment: user_185236.ezm (zipped)
Paula,

Quick question; Any reason you can't upgrade to Java 1.5 and use the primary
distribution and not a retrotranslated one?

Al.

P.S. Your problem is that your projects classes are being compiled with a
JDK >= 1.5.

----- Original Message -----
From: "Paula Estrella" <Paula.Estrella@(protected)>
To: <user@(protected)>
Sent: Thursday, April 10, 2008 10:20 AM
Subject: retrotranslating struts 2.0.11 not working


> Hello, We have a small application developed with struts2 for uploading
> files and returning the results of doing something with the files and we
> are trying to run struts2 with java 1.4.2 but it is not working after many
> attempts to remove the filter start error; could you please give us some
> hints?
> thanks a lot and we're sorry if someone already asked this.
> Paula
>
> the working environment is: tomcat 5.0.30, jdk 1.4.2, struts 2.0.11 on a
> linux suse server; we followed the procedure to retrotranslate the
> following files from struts-2.0.11-j4.zip
> commons-collections-3.1
> freemarker-2.3.4
> spring-aop-1.2.8
> spring-context-1.2.8
> spring-web-1.2.8
> struts2-core-2.0.1
> commons-logging-1.0.4
> ognl-2.6.7
> spring-beans-1.2.8
> spring-core-1.2.8
> struts2-api-2.0.1
> xwork-2.0-beta-1
>
> except for struts2-api-2.0.1, which we couldn't find anywhere.
>
> here's the stacktrace
>
> StandardContext[/project]Exception starting filter struts2
> java.lang.UnsupportedClassVersionError: project/FileUploadAction
> (Unsupported major.minor version 49.0)
>     at java.lang.ClassLoader.defineClass0(Native Method)
>     at java.lang.ClassLoader.defineClass (ClassLoader.java:808)
>     at
> java.security.SecureClassLoader.defineClass (SecureClassLoader.java:147)
>     at
> org.apache.catalina.loader.WebappClassLoader.findClassInternal (WebappClassLoader.java:1634)
>     at
> org.apache.catalina.loader.WebappClassLoader.findClass (WebappClassLoader.java:860)
>     at
> org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1307)
>     at
> org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1189)
>     at
> com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass (ClassLoaderUtil.java:139)
>     at
> com.opensymphony.xwork2.ObjectFactory.getClassInstance (ObjectFactory.java:100)
>     at
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction (XmlConfigurationProvider.java:366)
>     at
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction (XmlConfigurationProvider.java:329)
>     at
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage (XmlConfigurationProvider.java:429)
>     at
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages (XmlConfigurationProvider.java:239)
>     at
> org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages (StrutsXmlConfigurationProvider.java:111)
>     at
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload (DefaultConfiguration.java:152)
>     at
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration (ConfigurationManager.java:52)
>     at
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration (Dispatcher.java:395)
>     at
> org.apache.struts2.dispatcher.Dispatcher.init (Dispatcher.java:452)
>     at
> org.apache.struts2.dispatcher.FilterDispatcher.init (FilterDispatcher.java:201)
>     at
> org.apache.catalina.core.ApplicationFilterConfig.getFilter (ApplicationFilterConfig.java:225)
>     at
> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef (ApplicationFilterConfig.java:308)
>     at
> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
>     at
> org.apache.catalina.core.StandardContext.filterStart (StandardContext.java:3702)
>     at
> org.apache.catalina.core.StandardContext.start (StandardContext.java:4329)
>     at
> org.apache.catalina.core.ContainerBase.addChildInternal (ContainerBase.java:823)
>     at
> org.apache.catalina.core.ContainerBase.addChild (ContainerBase.java:807)
>     at
> org.apache.catalina.core.StandardHost.addChild (StandardHost.java:595)
>     at
> org.apache.catalina.core.StandardHostDeployer.install (StandardHostDeployer.java:277)
>     at
> org.apache.catalina.core.StandardHost.install (StandardHost.java:832)
>     at
> org.apache.catalina.startup.HostConfig.deployDirectories (HostConfig.java:701)
>     at
> org.apache.catalina.startup.HostConfig.deployApps (HostConfig.java:432)
>     at
> org.apache.catalina.startup.HostConfig.start (HostConfig.java:983)
>     at
> org.apache.catalina.startup.HostConfig.lifecycleEvent (HostConfig.java:349)
>     at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent (LifecycleSupport.java:119)
>     at
> org.apache.catalina.core.ContainerBase.start (ContainerBase.java:1091)
>     at
> org.apache.catalina.core.StandardHost.start (StandardHost.java:789)
>     at
> org.apache.catalina.core.ContainerBase.start (ContainerBase.java:1083)
>     at
> org.apache.catalina.core.StandardEngine.start (StandardEngine.java:478)
>     at
> org.apache.catalina.core.StandardService.start (StandardService.java:480)
>     at
> org.apache.catalina.core.StandardServer.start (StandardServer.java:2313)
>     at org.apache.catalina.startup.Catalina.start (Catalina.java:556)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:85)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:58)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java(Compiled
> Code))
>     at java.lang.reflect.Method.invoke (Method.java(Compiled Code))
>     at org.apache.catalina.startup.Bootstrap.start (Bootstrap.java:287)
>     at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:425)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>


Attachment: user_185243.ezm (zipped)
Antonio Petrelli wrote:

>2008/4/10, Paula Estrella <Paula.Estrella@(protected)>:
>
>
>>the working environment is: tomcat 5.0.30, jdk 1.4.2, struts 2.0.11 on a
>>linux suse server; we followed the procedure to retrotranslate the
>>following files from struts-2.0.11-j4.zip
>>  
>>
>
>
>
>The "j4" package contains already retrotranslated versions of Struts 2 and
>XWork.
>Moreover you want to retrotranslate struts 2.0.1 while you were using
>2.0.11... Just a mess, isn't it? :-D
>FYI: the latest release is 2.0.11.1
>http://struts.apache.org/download.cgi#struts20111
>Anyway the link to the retrotranslated release is wrong, replace "j4" with
>"backport".
>
>Antonio
>
>
>
Hello, sorry I just put the versions wrong in the post but we are indeed
using the retrotranslated version of struts2 and xworks (backport
instead of j4) and it is still not working.
We'd like to know what are the exact libraries we have to use and if we
have to retrotranslate other jars in order to make the examples work on
our server. For instance, in struts2-blank-2.0.11\WEB-INF\lib there is also
commons-logging-1.0.4.jar
freemarker-2.3.8.jar
ognl-2.6.11.jar

do we have to convert them to jdk1.4 ? is the folder structure ok?
thanks a lot,
Paula


Attachment: user_185245.ezm (zipped)
2008/4/10, Paula Estrella <Paula.Estrella@(protected)>:
> StandardContext[/project]Exception starting filter struts2
> java.lang.UnsupportedClassVersionError:
> project/FileUploadAction (Unsupported major.minor version 49.0)

As Al Sutton noticed before, is *your* class that is compiled with
Java 5 and put into a JDK 1.4 environment.

Antonio

Attachment: user_185240.ezm (zipped)
Hello,

first of all thanks for all your previous answers. Somehow,
I got the interceptor working for the simplest case, but
honestly I still dont know exactly why. Maybe it was a
caching issue.

Now I have some questions:

I have the "SimpleInterceptor":
>>>
public String intercept(ActionInvocation invocation) throws Exception {
System.out.println("The action is being intercepted!");
return invocation.invoke();    
//return Action.SUCCESS; (**)
}
<<<

and the struts.xml contains:
>>>
<action name="listRegistrationsWaiting"
class="registrationWaitingAction" method="execute">
<result>pages/list.jsp</result>
<result name="input">pages/list.jsp</result>
<interceptor-ref name="simpleInterceptor"/>      
</action>
<<<

When I comment in (**) instead of the return,
the result is not displayed (list.jsp) is not invoked.
I dont understand why, since the interceptor should
be called as the LAST step as far as I understand the
doc?! Therefore, there should be no influence of
the interceptor at the result at all!

But obvously, Im misunderstanding something, since I found
out that it works, when I just call return invocation.invoke();
But also in this case I wounder why the interceptor is called
BEFORE the DB Access (I can see that on the console),
since the interceptor is provided as the LAST part of the
action.

Thanks for your help
Peter



Attachment: user_185242.ezm (zipped)
Hi Peter,

On Thu, Apr 10, 2008 at 12:08 PM, Peter Theissen <peter.theissen@(protected):
<snip />
> I have the "SimpleInterceptor":
> >>>
> public String intercept(ActionInvocation invocation) throws Exception {
>  System.out.println("The action is being intercepted!");
>  return invocation.invoke();     //return Action.SUCCESS; (**)
> }
> <<<

You 'usually' don't return anything else from the intercept method
despite the return code of the action invocation itself. Anyway the
return of your interceptor leads back to the action invocation, which
then puts the resulting success-String into a local variable and
returns null. End of processing. So neither action nor result are
executed, as there never is a call to actionInvocation.invoke() at the
end of your interceptor stack, which whould do this. You only
understand what a recursion is, when you've understood recursion ;-)

> and the struts.xml contains:
> >>>
> <action name="listRegistrationsWaiting" class="registrationWaitingAction"
> method="execute">
>  <result>pages/list.jsp</result>
>  <result name="input">pages/list.jsp</result>
>  <interceptor-ref name="simpleInterceptor"/>       </action>
> <<<

You know this leaves you with only ONE interceptor on your interceptor
stack, the default stack is completely omitted! Means no configuration
parameters or URL parameters injected into your action, and lots of
other stuff you miss. Try something like

<action name="foo" class="org.bar.Foo">
<result>/foo.jsp</result>
<interceptor-ref name="defaultStack" />
<interceptor-ref name="simpleInterceptor" />
</action>

> When I comment in (**) instead of the return,
> the result is not displayed (list.jsp) is not invoked.
> I dont understand why, since the interceptor should
> be called as the LAST step as far as I understand the
> doc?! Therefore, there should be no influence of
> the interceptor at the result at all!

Nope. actionInvocation.invoke() calls the next intercepter on the
interceptor stack until there are no more interceptors. THEN the call
to actionInvocation.invoke() from the last interceptor on the stack
invokes the action. Thus in your example above the action never should
be called.

> But obvously, Im misunderstanding something, since I found
> out that it works, when I just call return invocation.invoke();
> But also in this case I wounder why the interceptor is called
> BEFORE the DB Access (I can see that on the console),
> since the interceptor is provided as the LAST part of the
> action.

Check out some more docs in the wiki, especially take a look at the
big picture[1] and interceptors[2].

Cheers,
-Ralf


[1] http://struts.apache.org/2.0.11.1/docs/big-picture.html
[2] http://struts.apache.org/2.x/docs/interceptors.html

Attachment: user_185241.ezm (zipped)
Hi Everybody.

Just want to know how to can I use "Autocompleter" as GMail style,
I mean, in GMail website, When I type more than 1 recipient name in
"To:" text box, the text box can complete with each recipient name.

I have checked Antocompleter document in Struts2 website, but didn't
find any useful information.

Thanks

Joey

Attachment: user_185244.ezm (zipped)
HI all,
I am using appfuse as start-up application for one project.
The problem is that when I upgraded from struts 2.0.11.1 to 2.1.1 my test
cases are no longer working as ActionContext.getContext() returns null.

http://www.mail-archive.com/dev@(protected)

I read about the refactoring of ActionContext and while I agree I cannot see
a quick-and-dirty workaround to solve this problem. How can I get a context
for running my tests now?
Thanks,
Oscar

Attachment: user_185248.ezm (zipped)
Hi.
I'm looking for documentation for the Table Tags plug-in. The projects
home page only contains a few JSP samples. A complete example with an
Action implementation would be of much help.


Lars

Attachment: user_185249.ezm (zipped)
hello everybody,

i'm very new with struts 2,and i'm developing a web interface i need to realise in few days; my problem is that i would like to create a web menu with n buttons, one for each category of a set; once a button associated with a specific category is pushed,i don't want a new action to be invoked, but a parametric action, depending on the button pushed(the name of the category to be the action parameter).
in struts.xml i made an action mapping this way:

<action name="sportNews" class="NewsAction">
<param name="category">sport</action>
<result>...</result>
</action>

<action name="gossipNews" class="NewsAction">
<param name="category">gossip</action>
<result>...</result>
</action>

my problem is that i don't know how to control the category parameter in a NewsAction class; in other words i would need a getParameter("category") method somewhere to be called, to recognize wich is the category associated with the previosuly pushed button.

i'm very sorry if my question is very stupid, but i need your
help...thank you very much,keep in touch ;-)
Daniele


©2008 gg3721.com - Jax Systems, LLC, U.S.A.