Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 19 Aug 2008 06:15:58 -0000 Issue 8200

user-digest-help

2008-08-19


Author LoginPost Reply

user Digest 19 Aug 2008 06:15:58 -0000 Issue 8200

Topics (messages 190163 through 190181):

Re: Static Content Loading in Struts 2
 190163 by: Ramez Hassan

Re: simple ajax form - returns value to a new page (not to a DIV)
 190164 by: Martin Gainty
 190176 by: Jeromy Evans

Re: Struts loses action configuration
 190165 by: Dustin Pearce

Re: Object put in HttpSession can't be found by S2
 190166 by: Dustin Pearce
 190167 by: Dave Newton
 190168 by: Martin Gainty
 190169 by: Dave Newton
 190171 by: Dustin Pearce

Struts 2 and Crystal Reports XI
 190170 by: James Neff
 190175 by: James Neff

Re: struts-core-2.0.11.2 in two places on the server, causing exceptions
 190172 by: Edwin Quita
 190173 by: Edwin Quita

Re: Select tag questions
 190174 by: Edwin Quita

Re: Could not find property [struts.valueStack] using struts 2.1.2
 190177 by: David N. Arnold
 190178 by: Jeromy Evans

Re: Problem with no configaration found
 190179 by: Muralidhar Y
 190180 by: Jeromy Evans

NullPointerException 5.5.17 Request.setAttribute(Request.java:1376)
 190181 by: Adam Jenkins

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_190163.ezm (zipped)
Thanks for the reply,

This is a lot helpful, and I also found that DispatcherFilter takes an
init-param called " packages" to include in static resources loading if and
only if StrutsConstants.STRUTS_SERVE_STATIC_BROWSER_CACHE property is set to
true.

Thanx again,

Ramez



-----Original Message-----
From: Musachy Barroso [mailto:musachy@(protected)]
Sent: Monday, August 18, 2008 4:11 PM
To: Struts Users Mailing List
Subject: Re: Static Content Loading in Struts 2

If you are building from trunk,

"To include static resources in your plugins add them under "/static"
in your jar. And include them in your page using "/static" as the
path, like in the following example:

Assuming /static/main.css is inside a plugin jar, to add it to the page:

<@(protected)" />
<link rel="stylesheet" type="text/css" href="%{#css}" />"

If your are using 2.0, there is a "hack" for it, you can put your
resources inside the jars under the dir:

org/apache/struts2/static/main.css

and then use "/struts" as the path:

<@(protected)" />
<link rel="stylesheet" type="text/css" href="%{#css}" />"

musachy


On Mon, Aug 18, 2008 at 10:00 AM, Ramez Hassan
<ramez.hassan@(protected):
> Hello Folks,
>
>
>
> I am trying to implement a theme enabled web application and the
> architecture is developed to upload themes to the application using jar or
> zip files with a certain directory structure. The problem is I don't know
> how to enable such a feature or how to extend struts control classes to
> perform such a thing.
>
>
>
> We are depending mainly on JSP 2.0 for the view and we need to reference
all
> images and css styles and layout from Jar files.
>
>
>
> Any Idea will be appreciated.
>
>
>
> Regards,
>
> Ramez Hassan
>
>



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

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


Attachment: user_190164.ezm (zipped)

you can send your action to javascript function
and use dojo to talk to the XMLHttpRequest object
parse the XML response
and then set innerHtml of the div tag to the parsed_response

<script language="JavaScript">


<!-- Begin


function doit()


{

var xmlhttp=dojo.hostenv.getXmlhttpObject()
var response= xmlhttp.responseXML;
var parsed_response=SomeXMLParser(response);
document.getElementByTagId("div").innerHtml = parsed_response;
-->
</script>

yes/no?
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.


> Date: Mon, 18 Aug 2008 21:18:44 +1000
> From: jeromy.evans@(protected)
> To: user@(protected)
> Subject: Re: struts2: simple ajax form - returns value to a new page (not to a DIV)
>
> MyAshok wrote:
> > I do have the same issue. on click of submit, the loadingtext is displaying
> > but the result in a new page as i am redirect to a action.
> >
> > Any solutions? please asap.
> >
> > <action name="activateSubscriber" class="subscriberAction"
> >      method="activateSubscriber">
> >      <result name="success" type="redirect-action">viewPartners</result>
> >    </action>
> > Waiting for reply......
> >
> >  
>
> If it's performing a full-page redirect, then your form did a plain old
> post/get to the action, not ajax.
> You will need to isolate why the request wasn't sent via XHR. That
> means it's a client-side problem, not a struts.xml problem.
>
> As a guess, without any context, if you've only tested in IE so far,
> turn off the loadingText message.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

_________________________________________________________________
Get ideas on sharing photos from people like you. Find new ways to share.
http://www.windowslive.com/explore/photogallery/posts?ocid=TXT_TAGLM_WL_Photo_Gallery_082008

Attachment: user_190176.ezm (zipped)
Martin Gainty wrote:
>
> var xmlhttp=dojo.hostenv.getXmlhttpObject()
> var response= xmlhttp.responseXML;
> var parsed_response=SomeXMLParser(response);
> document.getElementByTagId("div").innerHtml = parsed_response;
> -->
> </script>
>
> yes/no?
> Martin
>  

That would work, but dojo already includes code to invoke the right XML
parser depending on the browser and includes code to strip the
javascript out of the parsed response and execute it after updating the
DOM. So it's best to reuse that code (which is behaviour of the widget)
rather than rewrite an 80% complete solution.


Attachment: user_190165.ezm (zipped)
Are you seeing any thing in the log that would suggest that the app was reloaded? Are there any exceptions before the missing configuration?

When you first start it up you can address this action fine? What does the action do/use? How long before the action starts thowing the error?

Sent from my iPhone

On Aug 18, 2008, at 5:15 AM, tjstavenger <tjstavenger@(protected):


My application makes connections to our database through data sources
configured in WebLogic, and I'm not seeing any logs from WebLogic saying
that it has lost the connection... But I'll certainly keep an eye out for
it.

As for #1, which connection are you referring to. The database or something
else?

Thanks for the help,
Tim
--
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)



Attachment: user_190166.ezm (zipped)
Isn't OGNL supposed to search the value stack, then request, then session for a property value? Or his was a s:if test, so it is only the value stack?

Sent from my iPhone

On Aug 18, 2008, at 4:02 AM, "Ylva Degerfeldt" <ylva.degerfeldt@(protected):

Thank you all for your answers!

"#session.skillsFound" worked (Not "#skillsFound" but that doesn't
matter. One way to do it is enough.)

Now I have a new problem, but I'll take that in another mail.

/Ylva

On Sun, Aug 17, 2008 at 4:48 PM, "Stephan Schröder" <simon.void@(protected):
--- On Sun, 8/17/08, "Stephan Schröder" wrote:
i'm pretty sure <s:if test="#skillsFound != null"> works too.

AFAIK the "#" syntax will work only if the variable was defined as a named
stack context variable via something like <s:set...> or as the value of a
"var" ("id" in S2.0) attribute and so on.

Dave

good to know.

Thanks,
Stephan
--
GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196

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



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



Attachment: user_190167.ezm (zipped)
If it's prefixed with a "#" it will look for a context object with that name, AFAIK. And since it doesn't work with the "#"...

Dave


--- On Mon, 8/18/08, Dustin Pearce <dustin_pearce@(protected):

> From: Dustin Pearce <dustin_pearce@(protected)>
> Subject: Re: Object put in HttpSession can't be found by S2
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Monday, August 18, 2008, 10:55 AM
> Isn't OGNL supposed to search the value stack, then
> request, then session for a property value? Or his was a
> s:if test, so it is only the value stack?
>
> Sent from my iPhone
>
> On Aug 18, 2008, at 4:02 AM, "Ylva Degerfeldt"
> <ylva.degerfeldt@(protected):
>
> Thank you all for your answers!
>
> "#session.skillsFound" worked (Not
> "#skillsFound" but that doesn't
> matter. One way to do it is enough.)
>
> Now I have a new problem, but I'll take that in another
> mail.
>
> /Ylva
>
> On Sun, Aug 17, 2008 at 4:48 PM, "Stephan
> Schröder" <simon.void@(protected):
> --- On Sun, 8/17/08, "Stephan Schröder" wrote:
> i'm pretty sure <s:if test="#skillsFound !=
> null"> works too.
>
> AFAIK the "#" syntax will work only if the
> variable was defined as a named
> stack context variable via something like <s:set...>
> or as the value of a
> "var" ("id" in S2.0) attribute and so
> on.
>
> Dave
>
> good to know.
>
> Thanks,
> Stephan
> --
> GMX Kostenlose Spiele: Einfach online spielen und Spaß
> haben mit Pastry Passion!
> http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_190168.ezm (zipped)

yes OGNL will 'hunt' for Page,Request,Session andd then application for #attr.VariableName
http://struts.apache.org/2.x/docs/accessing-application-session-request-objects.html

are you seeing otherwise?
thx,
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.


> Date: Mon, 18 Aug 2008 07:55:55 -0700
> From: dustin_pearce@(protected)
> Subject: Re: Object put in HttpSession can't be found by S2
> To: user@(protected)
>
> Isn't OGNL supposed to search the value stack, then request, then session for a property value? Or his was a s:if test, so it is only the value stack?
>
> Sent from my iPhone
>
> On Aug 18, 2008, at 4:02 AM, "Ylva Degerfeldt" <ylva.degerfeldt@(protected):
>
> Thank you all for your answers!
>
> "#session.skillsFound" worked (Not "#skillsFound" but that doesn't
> matter. One way to do it is enough.)
>
> Now I have a new problem, but I'll take that in another mail.
>
> /Ylva
>
> On Sun, Aug 17, 2008 at 4:48 PM, "Stephan Schröder" <simon.void@(protected):
> --- On Sun, 8/17/08, "Stephan Schröder" wrote:
> i'm pretty sure <s:if test="#skillsFound != null"> works too.
>
> AFAIK the "#" syntax will work only if the variable was defined as a named
> stack context variable via something like <s:set...> or as the value of a
> "var" ("id" in S2.0) attribute and so on.
>
> Dave
>
> good to know.
>
> Thanks,
> Stephan
> --
> GMX Kostenlose Spiele: Einfach online spielen und Spaß haben mit Pastry Passion!
> http://games.entertainment.gmx.net/de/entertainment/games/free/puzzle/6169196
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

_________________________________________________________________
Get ideas on sharing photos from people like you. Find new ways to share.
http://www.windowslive.com/explore/photogallery/posts?ocid=TXT_TAGLM_WL_Photo_Gallery_082008

Attachment: user_190169.ezm (zipped)
--- On Mon, 8/18/08, Martin Gainty wrote:
> yes OGNL will 'hunt' for Page,Request,Session andd
> then application for #attr.VariableName
> http://struts.apache.org/2.x/docs/accessing-application-session-request-objects.html
>
> are you seeing otherwise?

That's only if you use #attr, which wasn't being done.

The post I replied to originally said that #foo would search the scopes, which it won't.

Dave


Attachment: user_190171.ezm (zipped)
Thanks Dave. So without the # it only hunts for wabbits in the value stack?

-D

On Aug 18, 2008, at 8:51 AM, Dave Newton <newton.dave@(protected):

--- On Mon, 8/18/08, Martin Gainty wrote:
yes OGNL will 'hunt' for Page,Request,Session andd
then application for #attr.VariableName
http://struts.apache.org/2.x/docs/accessing-application-session-request-objects.html

are you seeing otherwise?

That's only if you use #attr, which wasn't being done.

The post I replied to originally said that #foo would search the scopes, which it won't.

Dave


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



Attachment: user_190170.ezm (zipped)
I am trying to find a good example of how to use Crystal Reports XI with
Struts 2.

I found this:

http://www.jroller.com/njain/entry/crystal_reports_plus_struts

But the code does not work. I need to see the struts.xml example and the
author doesn't provide a list of required jar's.

I see how to do the Crystal Viewer from a plain 'ole jsp page but I want
to learn how to properly do it from a Struts Action class so that we can
integrate our business logic into the reports.

Can anyone provide a working sample application or point me in the right
direction?

Thanks,
James



Attachment: user_190175.ezm (zipped)
James Neff wrote:
> I am trying to find a good example of how to use Crystal Reports XI
> with Struts 2.
>
> I found this:
>
> http://www.jroller.com/njain/entry/crystal_reports_plus_struts
>
> But the code does not work. I need to see the struts.xml example and
> the author doesn't provide a list of required jar's.
>
> I see how to do the Crystal Viewer from a plain 'ole jsp page but I
> want to learn how to properly do it from a Struts Action class so that
> we can integrate our business logic into the reports.
> Can anyone provide a working sample application or point me in the
> right direction?
>
> Thanks,
> James
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Given the example from the URL in my first post I was able to get it to
work mostly under Struts 2 by making appropriate changes in the code.

Now I am able to see the Crystal Report from Struts2 but I am getting
the following error. Can someone point me in the right direction as to
how to fix it?

Thanks,
James

SEVERE: Servlet.service() for servlet default threw exception
java.lang.IllegalStateException
  at
org.apache.catalina.connector.ResponseFacade.sendError (ResponseFacade.java:407)
  at
org.apache.struts2.dispatcher.Dispatcher.sendError (Dispatcher.java:760)
  at
org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:513)
  at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:419)
  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:235)
  at
org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
  at
org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:233)
  at
org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:175)
  at
org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:128)
  at
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
  at
org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:109)
  at
org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:286)
  at
org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:844)
  at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
  at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
  at java.lang.Thread.run(Unknown Source)






Attachment: user_190172.ezm (zipped)
what we did with our deployment was to have the class loading setup to
load on a per module basis.
we have two struts2 portlet deployed with liferay5.1 on WAS. we had a
modules first and parent last setting for class loading.

you should check on your EAR deployment descriptor how class loading
was setup for your .ear application.

HTH,
/kits

On Thu, Aug 7, 2008 at 5:32 AM, Ylva Degerfeldt
<ylva.degerfeldt@(protected):
> Hi, dear Struts users!
>
> I'm trying to learn and use Struts 2 (actually migrating from Struts 1
> to 2) and I have written lots of java and xml code, which should be
> working. I just can't run the application! When I try to, I get this
> exception:
>
> Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with
> the name xwork has already been loaded by bean -
> jar:file:/C:/Sun/AppServer/domains/domain1/applications/j2ee-apps/Extract_to_cv_2/struts2-core-2.0.11.2.jar!/struts-default.xml:30:72
> - bean - jar:file:/C:/Sun/AppServer/domains/domain1/applications/j2ee-apps/Extract_to_cv_2/Extract_to_cv_2-war_war/WEB-INF/lib/struts2-core-2.0.11.2.jar!/struts-default.xml:30:72
>
> As the exception said, I found that the struts-core-2.0.11.2.jar file
> was located in two places under my application on the server. I tried
> to remove the topmost copy of the file but when I tried running the
> app. again I got the same exception, and found that the file had been
> put back there. Then I tried to remove the struts-core.. file that was
> further down, but the same thing happened! (the same exception and the
> file had been returned to that location as well).
>
> I'm using NetBeans 5.5.1 and Sun Java System Application Server 9 and
> my application is an enterprise application with a web module and an
> ejb module. I'm wondering whether this problem is due to that I have
> the struts2 jars in both the lib directory of the ejb module and the
> lib directory of the web module. This might be stupid, but I needed
> the ejb module to know about the struts classes as well and didn't
> know how to make them visible to the whole application.
>
> But then again, this (having struts jars in both modules) actually
> worked when I was using Struts 1.
>
> I'm really confused about this and I'm hoping that someone can help
> me! Maybe this is mostly a NetBeans issue so if someone who has used
> NetBeans could answer it would be great.
> I feel completely lost when it comes to this kind of things (what's
> happening "behind the scenes" in NetBeans and the app. server) but I'm
> willing to learn from anyone who wants to explain it to me. But please
> explain it very thoroughly then.
>
> Please help me! I'm stuck.
>
> /Ylva
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_190173.ezm (zipped)
here's the snippet for our deployment:

<?xml version="1.0" encoding="UTF-8"?>
<appdeployment:Deployment xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi"
xmi:id="Deployment_1218223750906">
<deployedObject xmi:type="appdeployment:ApplicationDeployment"
xmi:id="ApplicationDeployment_1218223750906" startingWeight="10">
  <modules xmi:type="appdeployment:WebModuleDeployment"
xmi:id="WebModuleDeployment_1218223750906" startingWeight="10000"
uri="liferay-portal-5.0.1.war" classloaderMode="PARENT_LAST"/>
  <modules xmi:type="appdeployment:WebModuleDeployment"
xmi:id="WebModuleDeployment_1218223750907" startingWeight="10000"
uri="Theme-theme.war" classloaderMode="PARENT_LAST"/>
  <modules xmi:type="appdeployment:WebModuleDeployment"
xmi:id="WebModuleDeployment_1218223750908" startingWeight="10000"
uri="PortalAdmin.war" classloaderMode="PARENT_LAST"/>
  <modules xmi:type="appdeployment:WebModuleDeployment"
xmi:id="WebModuleDeployment_1218223750909" startingWeight="10000"
uri="SysConf.war" classloaderMode="PARENT_LAST"/>
  <classloader xmi:id="Classloader_1218223750906" mode="PARENT_LAST"/>
</deployedObject>
</appdeployment:Deployment>


On Mon, Aug 18, 2008 at 1:52 PM, Edwin Quita <edwin.quita@(protected):
> what we did with our deployment was to have the class loading setup to
> load on a per module basis.
> we have two struts2 portlet deployed with liferay5.1 on WAS. we had a
> modules first and parent last setting for class loading.
>
> you should check on your EAR deployment descriptor how class loading
> was setup for your .ear application.
>
> HTH,
> /kits
>
> On Thu, Aug 7, 2008 at 5:32 AM, Ylva Degerfeldt
> <ylva.degerfeldt@(protected):
>> Hi, dear Struts users!
>>
>> I'm trying to learn and use Struts 2 (actually migrating from Struts 1
>> to 2) and I have written lots of java and xml code, which should be
>> working. I just can't run the application! When I try to, I get this
>> exception:
>>
>> Caused by: Bean type class com.opensymphony.xwork2.ObjectFactory with
>> the name xwork has already been loaded by bean -
>> jar:file:/C:/Sun/AppServer/domains/domain1/applications/j2ee-apps/Extract_to_cv_2/struts2-core-2.0.11.2.jar!/struts-default.xml:30:72
>> - bean - jar:file:/C:/Sun/AppServer/domains/domain1/applications/j2ee-apps/Extract_to_cv_2/Extract_to_cv_2-war_war/WEB-INF/lib/struts2-core-2.0.11.2.jar!/struts-default.xml:30:72
>>
>> As the exception said, I found that the struts-core-2.0.11.2.jar file
>> was located in two places under my application on the server. I tried
>> to remove the topmost copy of the file but when I tried running the
>> app. again I got the same exception, and found that the file had been
>> put back there. Then I tried to remove the struts-core.. file that was
>> further down, but the same thing happened! (the same exception and the
>> file had been returned to that location as well).
>>
>> I'm using NetBeans 5.5.1 and Sun Java System Application Server 9 and
>> my application is an enterprise application with a web module and an
>> ejb module. I'm wondering whether this problem is due to that I have
>> the struts2 jars in both the lib directory of the ejb module and the
>> lib directory of the web module. This might be stupid, but I needed
>> the ejb module to know about the struts classes as well and didn't
>> know how to make them visible to the whole application.
>>
>> But then again, this (having struts jars in both modules) actually
>> worked when I was using Struts 1.
>>
>> I'm really confused about this and I'm hoping that someone can help
>> me! Maybe this is mostly a NetBeans issue so if someone who has used
>> NetBeans could answer it would be great.
>> I feel completely lost when it comes to this kind of things (what's
>> happening "behind the scenes" in NetBeans and the app. server) but I'm
>> willing to learn from anyone who wants to explain it to me. But please
>> explain it very thoroughly then.
>>
>> Please help me! I'm stuck.
>>
>> /Ylva
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>

Attachment: user_190174.ezm (zipped)
there is a struts2-showcase-2.0.11.1.war included in the struts2
download bundle...

you can find a reference about the select tag in the UI Tags section

http://localhost:8010/struts2-showcase-2.0.11.1/tags/ui/

HTH,
/kits


On Fri, Aug 15, 2008 at 8:12 AM, David Barron <DBarron@(protected):
> I'm not exactly a newbie with struts but I do have what probably amount
> to newbie questions about the select tag and how to populate it.
> My action form contains fields called selectedTabs and unselectedTabs,
> both of which are arrays of Strings. I'd like to build a jsp page that
> displays the contents of those fields in select tags where I can select
> multiple rows. There are some somewhat helpful examples of single
> select tags but I haven't found any for multiple select.
>
> Here is my jsp code, greatly abbreviated:
> <html:form action="/SaveTabs.action">
> <table>
> <tr>
> <td>
> <br/>
> <b>Unavailable Tabs:</b><br/>
> <html:select style="width:350" property="unselectedTabs" size="10"
> multiple="true">
> </html:select>
> </td>
> <td>
> <br/><br/>
> <td>
> <br/>
> <b>Available Tabs:</b><br/>
> <html:select style="width:350" property="selectedTabs" size="10"
> multiple="true">
> </html:select>
> </td>
> </tr>
> </table>
> </html:form>
>
> The action form is getting populated before the jsp is displayed but how
> do I populate the select tags? Do I use option tags or optioncollection
> tags?
>
> If there are any web sites that contain some good SIMPLE examples that
> would help too.
>
> Thanks
>
> David Barron
> Consultant
> Zencos Consulting
> david.barron@(protected)
> www.zencos.com
> work: 919-459-4600 x 119
> mobile: 919-995-2356
> fax: 919-287-2335
> ______________________________________________________________
> The information in this e-mail and any attached files is confidential.
> It is intended solely for the use of the addressee. Any unauthorized
> disclosure or use is prohibited. If you are not the intended recipient
> of the message, please notify the sender immediately and do not disclose
> the contents to any other person, use it for any purpose, or store or
> copy the information in any medium. The views of the author may not
> necessarily reflect those of the company.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_190177.ezm (zipped)
You're not the only one. I can't remember if I was running trunk or
2.1.2, but I have seen the same messages.

On Thu, Aug 14, 2008 at 9:47 AM, "Stephan Schröder" <simon.void@(protected):
> hi,
>
> this is my first post to the mailing list so i hope this is the right place/email address.
>
> I wrote a 'hello world'-application using struts 2.1.2 using freemarker-result.
> The application works fine but the following warnings are displayed:
>
> INFO: Server startup in 757 ms
> 14.08.2008 15:12:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
> WARNUNG: Could not find property [struts.valueStack]
> 14.08.2008 15:12:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
> WARNUNG: Could not find property [.freemarker.Request]
> 14.08.2008 15:12:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
> WARNUNG: Could not find property [.freemarker.RequestParameters]
>
> Did i miss something?
>
> You can download the war-file here:
> http://www.file-upload.net/download-1042786/helloworld.war.html
>
> regards,
> Stephan
> --
> Psssst! Schon das coole Video vom GMX MultiMessenger gesehen?
> Der Eine für Alle: http://www.gmx.net/de/go/messenger03
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_190178.ezm (zipped)
David N. Arnold wrote:
> You're not the only one. I can't remember if I was running trunk or
> 2.1.2, but I have seen the same messages.
>
> On Thu, Aug 14, 2008 at 9:47 AM, "Stephan Schröder" <simon.void@(protected):
>  
>>
>> 14.08.2008 15:12:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
>> WARNUNG: Could not find property [struts.valueStack]
>>  
>  

They are normal in struts 2.1.2 as logging verbosity was increased.

Turning off devMode MAY hide them (I don't recall)
Otherwise disable the via your logging implementation.

It essentially means some time was wasted searching for something in the
valuestack that didn't exist. It reveals some significant inefficiencies
and are present because they should be resolved by S2 developers one day.





Attachment: user_190179.ezm (zipped)
Hi Dave, the following is the jsp page.

<%@(protected)"
  pageEncoding="ISO-8859-1"%>
<%@(protected)"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>  
 <title><s:text name="P_Search_Page" /></title>
</head>
<body>
 <s:actionmessage />
 <s:actionerror />
 <s:form action="executePoPSearch.action" >
   <table>
     <tr>
       <td><s:textfield name="searchText"
value="enter    search keywords here" size="100"  /></td>
       <td><s:submit value="search" /></td>
     </tr>
   </table>  
 </s:form>
</body>
</html>

Warm regards,
Muralidhar Y
muralidhary@(protected)

US Main: 877 KENSIUM (536.7486)
India Main: +91 9949495511
India Fax:  +91 9949495522
Kensium
200 S Wacker Dr, Suite 3100
Chicago, IL 60606


Confidentiality Note:
-----------------------------
The information contained in this e-mail is strictly confidential and for
the intended use of the addressee only. Any disclosure, use or copying of
the information by anyone other than the intended recipient is prohibited.
If you have received this message in error, please notify the sender
immediately by return e-mail and securely discard this message.

________________________________


-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Monday, August 18, 2008 6:57 PM
To: Struts Users Mailing List
Subject: Re: Problem with no configaration found

This is a duplication of your previous post, no?

As it seems there's a form involved perhaps posting the JSP would be a good
idea.


--- On Mon, 8/18/08, Muralidhar Y <muralidhary@(protected):

> From: Muralidhar Y <muralidhary@(protected)>
> Subject: Problem with no configaration found
> To: "'Struts Users Mailing List'" <user@(protected)>
> Date: Monday, August 18, 2008, 9:23 AM
> Hi friends I am getting the following error. I think it is a
> known issue.
> Kindly help me in this.
>
>
>
> No configuration found for the specified action:
> 'executePoPSearch.action'
> in namespace: '/p'. Form action defaulting to
> 'action' attribute's literal
> value.
>
>
>
> Warm regards,
>
> Muralidhar Y
>
> muralidhary@(protected)
>
>
>
> US Main: 877 KENSIUM (536.7486)
> India Main: +91 9949495511
>
> India Fax:  +91 9949495522
>
> Kensium
>
> 200 S Wacker Dr, Suite 3100
>
> Chicago, IL 60606
>
>
>
>
>
> Confidentiality Note:
> -----------------------------
> The information contained in this e-mail is strictly
> confidential and for
> the intended use of the addressee only. Any disclosure, use
> or copying of
> the information by anyone other than the intended recipient
> is prohibited.
> If you have received this message in error, please notify
> the sender
> immediately by return e-mail and securely discard this
> message.
>
>
>
>  _____

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


Attachment: user_190180.ezm (zipped)
Muralidhar Y wrote:
>  <s:form action="executePoPSearch.action" >
>  

It's an (annoying) warning caused by the line above.
It means it searched for an action in the configuration called
"executePoPSearch.action" but couldn't find it, so it's going to use the
literal value "executePoPSearch.action" instead.

The form tag includes code to generate an appropriate URL.
First it tries to see if you're referencing an action by name, and if
so, it asks the ActionMapper to generate a URL for it.
If it wasn't found, it assumes you're specifying the URL directly.

Make it go away using:

<s:form action="executePoPSearch" >



Attachment: user_190181.ezm (zipped)

I sent the following to the tomcat mailing list. Since it also involves struts I thought I'd also send it on here and see if anyone has any ideas

Cheers
Adam

________________________________

From: Adam Jenkins [mailto:AdamJenkins@(protected)]
Sent: Tue 19/08/2008 4:05 PM
To: users@(protected)
Subject: NullPointerException 5.5.17 Request.setAttribute(Request.java:1376)



Hi All,
I'be been tearing my hair out for a couple of weeks over this one and would appreciate any assistance anyone could give. It's a bit of a unique scenario, so it'll take me a little while to explain:
We have a legacy struts app, forwarding to a jsf app (details of how below) running on tomcat 5.5.17. 99.9% of the time everythign works great, but every now and then (which in users speak translates to 'I keep on getting', hence we can't ignore it) a NullPointerException gets thrown from org.apache.catalina.connector.Request.setAttribute.
The flow is:
Third party application ---<<http redirect>>---> JSFBridgeFilter (will explain later) -----> Struts application ----> JSFBridge--->JSF Application--->Response back to third party app.
The struts application contains proprietary logic to interface with the third party app, so we can't get rid of it. Business wants all development internally to be done in JSF, so we can't get rid of that.
The JSFBridgeFilter instantiates the JSF Context for later use, and wraps the request that is used to instantiate it in a request wrapper that translates ".do" context paths to ".jsf" context paths (otherwise all the forms submit back to ".do" after coming from the struts framework. It looks like this:
public void doFilter(ServletRequest strutsRequest, ServletResponse response, FilterChain chain) throws IOException, ServletException {

HttpServletRequest jsfRequest = new StrutsToJsfRequestWrapper((HttpServletRequest)strutsRequest);

JSFBridge.getFacesContext(viewId, (HttpServletRequest)jsfRequest, (HttpServletResponse)response);

chain.doFilter(strutsRequest, response);

}

...and the StrutsToJsfRequestWrapper contains only one override method (it extends HttpServletRequestWrapper):
@Override

public String getServletPath() {

    String oldPath = super.getServletPath();

    String newPath = null;

    int index = oldPath.lastIndexOf(".do");

    if (index >= 0) {

          newPath = oldPath.substring(0, index + 1) + ".jsf";

    } else {

          newPath = oldPath;

    }

    return newPath;

}



Now, you'll notice in the filter that the request wrapper is used to instantiate the faces context, and the original request passed onto the struts application. The 'getFacesContext' method implements some code from the apache myfaces wiki that shows a way to call into the JSF framework from non jsf artifacts:



It looks like this:



public class JSFBridge {



    private abstract static class InnerFacesContext extends FacesContext {

          protected static void setFacesContextAsCurrentInstance(final FacesContext facesContext) {

               FacesContext.setCurrentInstance(facesContext);

          }

    }



    public static FacesContext getFacesContext(final String viewId, final ServletRequest request, final ServletResponse response) {

          FacesContext facesContext = FacesContext.getCurrentInstance();

          if (facesContext != null) {

               return facesContext;

          }

          return getNewFacesContext(viewId, request, response);

    }



    public static FacesContext getNewFacesContext(final String viewId, final ServletRequest request, final ServletResponse response) {

          FacesContext facesContext;

          FacesContextFactory contextFactory = (FacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);

          LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);

          Lifecycle lifecycle = lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);

          facesContext = contextFactory.getFacesContext(((HttpServletRequest)request).getSession().getServletContext(),request, response, lifecycle);

          InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);

          UIViewRoot view = facesContext.getApplication().getViewHandler().createView(facesContext, viewId);

          facesContext.setViewRoot(view);

          return facesContext;

    }

}



And the final piece of the puzzle is a struts action that actually loads the context and forwards to the appropriate JSF method...which looks like this:



public class ForwardToJSFAction extends Action {

   

    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

          JSFMapping viewMapping = (JSFMapping) mapping;

          FacesContext ctx = JSFBridge.getFacesContext(viewMapping.getViewId(), request, response);

          MethodBinding mb = lookupMethodBinding(viewMapping, ctx);

          navigateToMethodBinding(viewMapping, ctx, mb);

          return null;

    }



    private MethodBinding lookupMethodBinding(JSFMapping viewMapping, FacesContext ctx) {

          return ctx.getApplication().createMethodBinding("#{" + viewMapping.getJsfAction() + "}", new Class[] {});

    }



    private void navigateToMethodBinding(JSFMapping viewMapping, FacesContext ctx, MethodBinding mb) {

          Object obj = mb.invoke(ctx, new Object[] {});

          NavigationHandler navHandler = ctx.getApplication().getNavigationHandler();

          navHandler.handleNavigation(ctx, "#{" + viewMapping.getJsfAction() + "}", (String) obj);

    }

}



Now, as odd as all this looks, it actually works quite well in 99.9% of the cases. We get a request in struts, which forwards quite nicely onto a JSF method and completes the business process in JSF. Every now and then though, we get the following error when we try to invoke the method binding:

Caused by: java.lang.NullPointerException
    at org.apache.catalina.connector.Request.setAttribute (Request.java:1376)
    at org.apache.catalina.connector.RequestFacade.setAttribute (RequestFacade.java:500)
    at javax.servlet.ServletRequestWrapper.setAttribute (ServletRequestWrapper.java:283)
    at org.apache.myfaces.context.servlet.RequestMap.setAttribute (RequestMap.java:46)
    at org.apache.myfaces.context.servlet.AbstractAttributeMap.put (AbstractAttributeMap.java:104)
    at org.apache.myfaces.el.VariableResolverImpl.resolveVariable (VariableResolverImpl.java:301)
    at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
    at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:574)
    at org.apache.commons.el.NamedValue.evaluate (NamedValue.java:124)
    at org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty (ValueBindingImpl.java:455)
    at org.apache.myfaces.el.MethodBindingImpl.resolveToBaseAndProperty (MethodBindingImpl.java:180)
    at org.apache.myfaces.el.MethodBindingImpl.invoke (MethodBindingImpl.java:114)
Diving into Request.java(Line 1376), shows that it's happening on this line:
Object listeners[] = context.getApplicationEventListeners();
So I'm guessing that 'context' is null for some reason. Since it is so rare, it's almost impossible to reproduce in a manner consistent enough to actually diagnose and debug it.
Can anyone see, from the above, anything that could shed some light on this?
Cheers
Adam

Number 1 in Truck Insurance

______________________________________________________________________
CAUTION - This message is intended for the addressee named above.

It may contain privileged or confidential information. If you are
not the intended recipient of this message you must not use,
copy, distribute or disclose it to anyone other than the addressee.
If you have received this email in error please return the message to the sender by replying to it and then delete the message from your computer.

Internet e-mails are not necessarily secure.
National Transport Insurance does not accept responsibility for changes made to this message after it was sent.
______________________________________________________________________


Number 1 in Truck Insurance

______________________________________________________________________
CAUTION - This message is intended for the addressee named above.

It may contain privileged or confidential information. If you are
not the intended recipient of this message you must not use,
copy, distribute or disclose it to anyone other than the addressee.
If you have received this email in error please return the message to the sender by replying to it and then delete the message from your computer.

Internet e-mails are not necessarily secure.
National Transport Insurance does not accept responsibility for changes made to this message after it was sent.
______________________________________________________________________
©2008 gg3721.com - Jax Systems, LLC, U.S.A.