Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 19 Jul 2009 02:08:00 -0000 Issue 8759

user-digest-help

2009-07-18


Author LoginPost Reply

user Digest 19 Jul 2009 02:08:00 -0000 Issue 8759

Topics (messages 200869 through 200880):

Tags as template parameters?
 200869 by: Pascal
 200875 by: Wes Wannemacher

null and zero issue
 200870 by: Russo, Joe
 200874 by: Dave Newton

Ghostly exception
 200871 by: Peter Bliznak

Re: Struts2 + JPA - Lazy Initialization During View Generation
 200872 by: Nathan Schulte

Re: Help with a redirect
 200873 by: Dave Newton

Struts w/Ajax with Struts again
 200876 by: cpanon
 200879 by: Martin Gainty
 200880 by: cpanon

XML data in request parameter gotchas?
 200877 by: Michael Finney

Exception though the result looks as expected
 200878 by: mathias-ewald

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_200869.ezm (zipped)
Hello list,

in Struts2 it is possible to do something like

<html>
<body>
<s:myMainNavigationMenu />

<h1>A page</h1>
<p>Some content</p>
</body>
</html>

This works ok, but my problem is that I have to change every single
page, if i would like to have a custom footer for every page, for example.

Now my question is: Is it possible to do something like this?

<s:useTemplate name="myCommonTemplate">
  <s:setTemplateTag name="body">
    <h1>A page</h1>
    <p>Some content</p>
  </s:setTemplateTag>
</s:useTemplate>

And as template definition say

<!-- Main menu -->
<table>...</table>

<s:insertTemplateTag name="body" />

<!-- Footer -->
<p>This is the footer</p>

I know it is possible to use parameters for templates, but they
obviously have huge limitations as I can't just put the tags there as I
did in my example.

Also, I could do something like

<s:myMainTemplate>
<s:param name="bodyPage" value="page1.jsp" />
</s:myMainTemplate>

which I also don't want because I would have an extra (unnecessary) page.

So, is it possible to pass whole XML-Structures to templates? Maybe you
have some reasons why I shouldn't want what I'm suggesting here, I would
be eager to hear them! :-)

Pascal


Attachment: user_200875.ezm (zipped)
I'm on my phone so I only skimmed your message. If I read correctly,
you should take a look at sitemesh.

-W

On 7/17/09, Pascal <pascal@(protected):
> Hello list,
>
> in Struts2 it is possible to do something like
>
> <html>
> <body>
>  <s:myMainNavigationMenu />
>
>  <h1>A page</h1>
>  <p>Some content</p>
> </body>
> </html>
>
> This works ok, but my problem is that I have to change every single
> page, if i would like to have a custom footer for every page, for example.
>
> Now my question is: Is it possible to do something like this?
>
> <s:useTemplate name="myCommonTemplate">
>   <s:setTemplateTag name="body">
>      <h1>A page</h1>
>      <p>Some content</p>
>   </s:setTemplateTag>
> </s:useTemplate>
>
> And as template definition say
>
> <!-- Main menu -->
> <table>...</table>
>
> <s:insertTemplateTag name="body" />
>
> <!-- Footer -->
> <p>This is the footer</p>
>
> I know it is possible to use parameters for templates, but they
> obviously have huge limitations as I can't just put the tags there as I
> did in my example.
>
> Also, I could do something like
>
> <s:myMainTemplate>
> <s:param name="bodyPage" value="page1.jsp" />
> </s:myMainTemplate>
>
> which I also don't want because I would have an extra (unnecessary) page.
>
> So, is it possible to pass whole XML-Structures to templates? Maybe you
> have some reasons why I shouldn't want what I'm suggesting here, I would
> be eager to hear them! :-)
>
> Pascal
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


Attachment: user_200870.ezm (zipped)
I know this may not be the appropriate group to send this, but I think
this is a general issue that I am not aware of and this group is active
and thought I'd give it a shot.



I wrote a web service component using JAX-WS API and deployed on JBoss
5.0.1 application server. And also, wrote a Soap client which sends a
valid soap request to server and server executes corresponding method
and returns soap response back to client but what ever parameters I
included in soap, it considers it as null for string datatype and zero
for int data type.



Appreciate if you could help me to resolve this problem.

Joe


****

Attachment: user_200874.ezm (zipped)
Russo, Joe wrote:
> I know this may not be the appropriate group to send this, but I think
> this is a general issue that I am not aware of and this group is active
> and thought I'd give it a shot.

Wouldn't a web service list/forum be a better bet?

Dave


Attachment: user_200871.ezm (zipped)
Hi folk,
noticed few days ago app is throwing following exception but everything is working
fine I see no problems whatsoever. But obviously I would be happier camper if
I had clean runs.
All ideas welcome.
Almost forgot running S_2.1.6 on WebShpere 6.1.
Peter.


[17/07/09 16:32:06:747 EDT] 0000002c OgnlValueStac W org.apache.commons.logging.impl.Jdk14Logger warn Error setting value
                     ognl.OgnlException: target is null for setProperty(null, "next", [Ljava.lang.String;@(protected))
  at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1651)
  at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
  at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
  at ognl.SimpleNode.setValue(SimpleNode.java:246)
  at ognl.ASTChain.setValueBody(ASTChain.java:172)
  at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
  at ognl.SimpleNode.setValue(SimpleNode.java:246)
  at ognl.Ognl.setValue(Ognl.java:476)
  at com.opensymphony.xwork2.ognl.OgnlUtil.setValue (OgnlUtil.java:192)
  at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue (OgnlValueStack.java:155)
  at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue (OgnlValueStack.java:143)
  at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters (ParametersInterceptor.java:273)
  at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:187)
  at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:195)
  at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept (StaticParametersInterceptor.java:148)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at org.apache.struts2.interceptor.CheckboxInterceptor.intercept (CheckboxInterceptor.java:93)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at org.apache.struts2.interceptor.FileUploadInterceptor.intercept (FileUploadInterceptor.java:235)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept (ModelDrivenInterceptor.java:89)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept (ScopedModelDrivenInterceptor.java:128)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept (ProfilingActivationInterceptor.java:104)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept (DebuggingInterceptor.java:267)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept (ChainingInterceptor.java:126)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept (PrepareInterceptor.java:138)
  at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept (I18nInterceptor.java:148)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept (ServletConfigInterceptor.java:164)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept (AliasInterceptor.java:128)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept (ExceptionMappingInterceptor.java:176)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at ca.on.gov.ebc.esdi.dd.webc.presentation.common.interceptors.LoggerInterceptor.intercept(LoggerInterceptor.java:18)
  at com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
  at org.apache.struts2.impl.StrutsActionProxy.execute (StrutsActionProxy.java:52)
  at org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:468)
  at org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:395)
  at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
  at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
  at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
  at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
  at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:628)
  at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:145)
  at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:595)
  at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:111)
  at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
  at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
  at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
  at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
  at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
  at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
  at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
  at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
  at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
  at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
  at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
  at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
  at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
  at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
  at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)

Attachment: user_200872.ezm (zipped)
Nathan Schulte <nathan.schulte <at> ngc.com> writes:
> I'll let you know what I come up with.

Well, I was able to get this to work. The interceptor is placed on the end of
the stack, although it's location oughtn't matter. Also, it is placed on the
stack for _all_ actions. I'm not sure if this is a problem, it may actually be
a good thing (at least in my case, I was not wrapping all of the actions' calls
to the EJBs in a UserTransaction, this takes care of that, everywhere). Also
note, this doesn't support transaction rollback in it's current form. As a
simple test, it worked though.

This would look ten times prettier if only the container supported resource
injection, :).

http://pastebin.com/f3c76ae6f

-Nate



Attachment: user_200873.ezm (zipped)
Is it actually not being set on the action, or is this just the normal
log message for parameters that don't exist in the result?

Dave

Security Management wrote:
> OK, tried adding the "parse" param, and still no luck...
>
> <action name="unlock"
> class="com.secmgmt.struts2.actions.door_control.DoorControlUnlockDoor">
>      <result name="success" type="redirectAction">
>        <param name="actionName">statusAjax</param>
>        <param name="door.id">${door.id}</param>
>        <param name="parse">true</param>
>      </result>
> </action>
>
> -----Original Message-----
> From: Security Management [mailto:list-subscriptions@(protected)]
> Sent: Friday, July 17, 2009 9:56 AM
> To: 'Struts Users Mailing List'
> Subject: Help with a redirect
>
> When my index page loads, ajax requests are posted to the statusAjax page
> with a parameter of door.id equal to x for the doors.
>
> That works fine, and is a POST.
>
> When I click on an icon, it posts to the identical action, to either lock or
> unlock. When the action is done, I redirect to the status action (just like
> when the index loads, except with a GET this time). I get an exception
> setting the door.id, but the url shows that the get value and property name
> are right for the redirect action. Can someone explain what I am doing
> wrong? The action works on the index ajax calls, but future clicks give me:
>
> Caused by: ognl.NoSuchPropertyException:
> org.apache.struts2.dispatcher.ServletActionRedirectResult.door
>
> Here is the struts.xml
>
> <action name="index"
> class="com.secmgmt.struts2.actions.door_control.DoorControlIndexAction">
>     <result
> name="success">/pages/door-control/jsps/index-ajax.jsp</result>
> </action>
> <action name="lock"
> class="com.secmgmt.struts2.actions.door_control.DoorControlLockDoor">
>  <result name="success" type="redirectAction">
>    <param name="actionName">statusAjax</param>
>  <param name="door.id">${door.id}</param>
> </result>
> </action>
>    
> <action name="unlock"
> class="com.secmgmt.struts2.actions.door_control.DoorControlUnlockDoor">
>  <result name="success" type="redirectAction">
>    <param name="actionName">statusAjax</param>
>      <param name="door.id">${door.id}</param>
>  </result>
> </action>
>
> <action name="statusAjax"
> class="com.secmgmt.struts2.actions.door_control.AjaxDoorStatus">
>  <result
> name="success">/pages/door-control/jsps/single-door-ajax.jsp</result>
> </action>
>
>
> ---------------------------------------------------------------------
> 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_200876.ezm (zipped)
Hello
I am able to use an Ajax call to a struts action and with getInputForward() get the get the data back.  (With prototpye and json, very, very elegant).  I am now realizing that I have cases where I want to reprocess all components, i.e. I want the actionForm to be updated and the jsp recalculated, I want the session objects to be reprocessed so my iterate tags will show the updates, etc.  I understand how with getInputForward it doesnt happen.  If I setAttribute(), the original value that was processed when the form first generated is all that ever shows.  A simple findForward() does not force the reprocessing,ie still the original values of the actionsForm members.  Is there a way to force a complete reprocessing the jsp from within an action?  tia.

Attachment: user_200879.ezm (zipped)

ajax's responsibility is to return either json or html formatted text to innerHtml attribute of div tag identified in ajax call



other activity such as refreshing session attributes would need to take place

in the action class..upon return from action all tags of the jsp would re-display the content based on the refreshed state for those session attributes



another strategy is to create and/or modify a jsp in the action and on return forwards to a result *which will forward to the just created or modified jsp*


you're welcome
Martin
______________________________________________
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.





> Date: Fri, 17 Jul 2009 18:45:18 -0700
> From: cpanon@(protected)
> Subject: Struts w/Ajax with Struts again
> To: user@(protected)
>
> Hello
> I am able to use an Ajax call to a struts action and with getInputForward() get the get the data back. (With prototpye and json, very, very elegant). I am now realizing that I have cases where I want to reprocess all components, i.e. I want the actionForm to be updated and the jsp recalculated, I want the session objects to be reprocessed so my iterate tags will show the updates, etc. I understand how with getInputForward it doesnt happen. If I setAttribute(), the original value that was processed when the form first generated is all that ever shows. A simple findForward() does not force the reprocessing,ie still the original values of the actionsForm members. Is there a way to force a complete reprocessing the jsp from within an action? tia.

_________________________________________________________________
Windows Live™ Hotmail®: Search, add, and share the web’s latest sports videos. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_videos_072009&cat=sports

Attachment: user_200880.ezm (zipped)
Hi Martin
Thank you.  So I may be misunderstanding something.  If I return to the Ajax call with mapping.getInputForward() for the defined input attribute of that action processing the Ajax call, should I see changes in the session objects displayed?  Because before I return I set an element in the actionForm.setSeeMe("hi"), set the session.setAttribute("actionForm", modified) and I do not see it in the display.  I am accessing that element with the ${seeMe} syntax.  I am seeing the json results, but not what I put in the actionForm.  That is what I would "organically" expect to see.  Can you clarify this?  tia.

--- On Sat, 7/18/09, Martin Gainty <mgainty@(protected):

From: Martin Gainty <mgainty@(protected)>
Subject: RE: Struts w/Ajax with Struts again
To: "Struts Users Mailing List" <user@(protected)>
Date: Saturday, July 18, 2009, 9:32 PM


ajax's responsibility is to return either json or html formatted text to innerHtml attribute of div tag identified in ajax call



other activity such as refreshing session attributes would need to take place

in the action class..upon return from action all tags of the jsp would re-display the content based on the refreshed state for those session attributes



another strategy is to create and/or modify a jsp in the action and on return forwards to a result *which will forward to the just created or modified jsp*


you're welcome
Martin
______________________________________________
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.





> Date: Fri, 17 Jul 2009 18:45:18 -0700
> From: cpanon@(protected)
> Subject: Struts w/Ajax with Struts again
> To: user@(protected)
>
> Hello
> I am able to use an Ajax call to a struts action and with getInputForward() get the get the data back.  (With prototpye and json, very, very elegant).  I am now realizing that I have cases where I want to reprocess all components, i.e. I want the actionForm to be updated and the jsp recalculated, I want the session objects to be reprocessed so my iterate tags will show the updates, etc.  I understand how with getInputForward it doesnt happen.  If I setAttribute(), the original value that was processed when the form first generated is all that ever shows.  A simple findForward() does not force the reprocessing,ie still the original values of the actionsForm members.  Is there a way to force a complete reprocessing the jsp from within an action?  tia.

_________________________________________________________________
Windows Live™ Hotmail®: Search, add, and share the web’s latest sports videos. Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_videos_072009&cat=sports

Attachment: user_200877.ezm (zipped)
Hi,

If a client is sending us XML via HTTP POST, are there any gotcha's with
struts2?

Also, what is a great way to send test XML data using an HTTP POST; just
populate a form field and submit it?

Thanks.




Attachment: user_200878.ezm (zipped)

Hi,

this is the JSP script that causes the Exception:

-----------------------------
<%@(protected)"
  pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@(protected)" %>
<%@(protected)" %>

<div class="resultElement">

 <div style=" width: 40%; float: right">
   <s:set var="average" value="#stat.average" />
   
   <%
   float average =
(Float)ActionContext.getContext().getValueStack().findValue("#average");
   %>
   
   <% if(average < 0.25f) { %>
     <button class="rating-icon-empty"></button>
   <% } else if(average >= 0.25f && average < 0.75f) { %>
     <button class="rating-icon-half"></button>
   <% } else { %>
     <button class="rating-icon-full"></button>
   <% } %>
 
   <% if(average < 1.25f) { %>
     <button class="rating-icon-empty"></button>
   <% } else if(average >= 1.25f && average < 1.75f) { %>
     <button class="rating-icon-half"></button>
   <% } else { %>
     <button class="rating-icon-full"></button>
   <% } %>
 
   <% if(average < 2.25f) { %>
     <button class="rating-icon-empty"></button>
   <% } else if(average >= 2.25f && average < 2.75f) { %>
     <button class="rating-icon-half"></button>
   <% } else { %>
     <button class="rating-icon-full"></button>
   <% } %>
 
   <% if(average < 3.25f) { %>
     <button class="rating-icon-empty"></button>
   <% } else if(average >= 3.25f && average < 3.75f) { %>
     <button class="rating-icon-half"></button>
   <% } else { %>
     <button class="rating-icon-full"></button>
   <% } %>
   
   <% if(average < 4.25f) { %>
     <button class="rating-icon-empty"></button>
   <% } else if(average >= 4.25f && average < 4.75f) { %>
     <button class="rating-icon-half"></button>
   <% } else { %>
     <button class="rating-icon-full"></button>
   <% } %>  
 </div>

 <h3>
   <s:property value="#criterion.name"/>
 </h3>
 
 <table>
   <tr>
     <td>Range:</td>
     <td>&nbsp;&nbsp;&nbsp;</td>
     <td><s:property value="#criterion.min" /> to <s:property
value="#criterion.max" /></td>
   </tr>
   <tr>
     <td>Average:</td>
     <td>&nbsp;&nbsp;&nbsp;</td>
     <td>${average}</td>
   </tr>
 </table>

</div>
-----------------------------

and this is the exception:

-----------------------------
ul 18, 2009 8:03:03 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
 at
org.apache.jsp.details.StaffCriterionStat_jsp._jspService(StaffCriterionStat_jsp.java:76)
 at org.apache.jasper.runtime.HttpJspBase.service (HttpJspBase.java:70)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:717)
 at
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:374)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:342)
 at org.apache.jasper.servlet.JspServlet.service (JspServlet.java:267)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:717)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:290)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
 at
org.apache.catalina.core.ApplicationDispatcher.invoke (ApplicationDispatcher.java:646)
 at
org.apache.catalina.core.ApplicationDispatcher.doInclude (ApplicationDispatcher.java:551)
 at
org.apache.catalina.core.ApplicationDispatcher.include (ApplicationDispatcher.java:488)
 at org.apache.struts2.components.Include.include (Include.java:254)
 at org.apache.struts2.components.Include.end (Include.java:166)
 at
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag (ComponentTagSupport.java:42)
 at
org.apache.jsp.details.FreelancerDetails_jsp._jspx_meth_s_005finclude_005f0(FreelancerDetails_jsp.java:535)
 at
org.apache.jsp.details.FreelancerDetails_jsp._jspx_meth_s_005fiterator_005f0(FreelancerDetails_jsp.java:462)
 at
org.apache.jsp.details.FreelancerDetails_jsp._jspx_meth_s_005fsort_005f0(FreelancerDetails_jsp.java:416)
 at
org.apache.jsp.details.FreelancerDetails_jsp._jspService(FreelancerDetails_jsp.java:176)
 at org.apache.jasper.runtime.HttpJspBase.service (HttpJspBase.java:70)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:717)
 at
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:374)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:342)
 at org.apache.jasper.servlet.JspServlet.service (JspServlet.java:267)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:717)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:290)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
 at
org.apache.catalina.core.ApplicationDispatcher.invoke (ApplicationDispatcher.java:646)
 at
org.apache.catalina.core.ApplicationDispatcher.processRequest (ApplicationDispatcher.java:436)
 at
org.apache.catalina.core.ApplicationDispatcher.doForward (ApplicationDispatcher.java:374)
 at
org.apache.catalina.core.ApplicationDispatcher.forward (ApplicationDispatcher.java:302)
 at
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute (ServletDispatcherResult.java:154)
 at
org.apache.struts2.dispatcher.StrutsResultSupport.execute (StrutsResultSupport.java:186)
 at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult (DefaultActionInvocation.java:361)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:265)
 at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept (DefaultWorkflowInterceptor.java:163)
 at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept (ValidationInterceptor.java:249)
 at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept (AnnotationValidationInterceptor.java:68)
 at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept (ConversionErrorInterceptor.java:122)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:195)
 at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:195)
 at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept (StaticParametersInterceptor.java:148)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.interceptor.CheckboxInterceptor.intercept (CheckboxInterceptor.java:93)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.interceptor.FileUploadInterceptor.intercept (FileUploadInterceptor.java:235)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept (ModelDrivenInterceptor.java:89)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept (ScopedModelDrivenInterceptor.java:128)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept (ProfilingActivationInterceptor.java:104)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept (DebuggingInterceptor.java:267)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept (ChainingInterceptor.java:126)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept (PrepareInterceptor.java:138)
 at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept (I18nInterceptor.java:148)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept (ServletConfigInterceptor.java:164)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept (AliasInterceptor.java:128)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept (ExceptionMappingInterceptor.java:176)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.impl.StrutsActionProxy.execute (StrutsActionProxy.java:52)
 at
org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:468)
 at
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
 at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)
 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:191)
 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:293)
 at
org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:849)
 at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
 at java.lang.Thread.run (Thread.java:619)
20:03:03,260 WARN Include:49 - Exception thrown during include of
/details/StaffCriterionStat.jsp
org.apache.jasper.JasperException: java.lang.NullPointerException
 at
org.apache.jasper.servlet.JspServletWrapper.handleJspException (JspServletWrapper.java:522)
 at
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:416)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:342)
 at org.apache.jasper.servlet.JspServlet.service (JspServlet.java:267)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:717)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:290)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
 at
org.apache.catalina.core.ApplicationDispatcher.invoke (ApplicationDispatcher.java:646)
 at
org.apache.catalina.core.ApplicationDispatcher.doInclude (ApplicationDispatcher.java:551)
 at
org.apache.catalina.core.ApplicationDispatcher.include (ApplicationDispatcher.java:488)
 at org.apache.struts2.components.Include.include (Include.java:254)
 at org.apache.struts2.components.Include.end (Include.java:166)
 at
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag (ComponentTagSupport.java:42)
 at
org.apache.jsp.details.FreelancerDetails_jsp._jspx_meth_s_005finclude_005f0(FreelancerDetails_jsp.java:535)
 at
org.apache.jsp.details.FreelancerDetails_jsp._jspx_meth_s_005fiterator_005f0(FreelancerDetails_jsp.java:462)
 at
org.apache.jsp.details.FreelancerDetails_jsp._jspx_meth_s_005fsort_005f0(FreelancerDetails_jsp.java:416)
 at
org.apache.jsp.details.FreelancerDetails_jsp._jspService(FreelancerDetails_jsp.java:176)
 at org.apache.jasper.runtime.HttpJspBase.service (HttpJspBase.java:70)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:717)
 at
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:374)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:342)
 at org.apache.jasper.servlet.JspServlet.service (JspServlet.java:267)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:717)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:290)
 at
org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:206)
 at
org.apache.catalina.core.ApplicationDispatcher.invoke (ApplicationDispatcher.java:646)
 at
org.apache.catalina.core.ApplicationDispatcher.processRequest (ApplicationDispatcher.java:436)
 at
org.apache.catalina.core.ApplicationDispatcher.doForward (ApplicationDispatcher.java:374)
 at
org.apache.catalina.core.ApplicationDispatcher.forward (ApplicationDispatcher.java:302)
 at
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute (ServletDispatcherResult.java:154)
 at
org.apache.struts2.dispatcher.StrutsResultSupport.execute (StrutsResultSupport.java:186)
 at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult (DefaultActionInvocation.java:361)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:265)
 at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept (DefaultWorkflowInterceptor.java:163)
 at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept (ValidationInterceptor.java:249)
 at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept (AnnotationValidationInterceptor.java:68)
 at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept (ConversionErrorInterceptor.java:122)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:195)
 at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept (ParametersInterceptor.java:195)
 at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept (StaticParametersInterceptor.java:148)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.interceptor.CheckboxInterceptor.intercept (CheckboxInterceptor.java:93)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.interceptor.FileUploadInterceptor.intercept (FileUploadInterceptor.java:235)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept (ModelDrivenInterceptor.java:89)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept (ScopedModelDrivenInterceptor.java:128)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept (ProfilingActivationInterceptor.java:104)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept (DebuggingInterceptor.java:267)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept (ChainingInterceptor.java:126)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept (PrepareInterceptor.java:138)
 at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept (MethodFilterInterceptor.java:87)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept (I18nInterceptor.java:148)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept (ServletConfigInterceptor.java:164)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept (AliasInterceptor.java:128)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept (ExceptionMappingInterceptor.java:176)
 at
com.opensymphony.xwork2.DefaultActionInvocation.invoke (DefaultActionInvocation.java:236)
 at
org.apache.struts2.impl.StrutsActionProxy.execute (StrutsActionProxy.java:52)
 at
org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:468)
 at
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
 at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)
 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:191)
 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:293)
 at
org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:849)
 at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
 at java.lang.Thread.run (Thread.java:619)
Caused by: java.lang.NullPointerException
 at
org.apache.jsp.details.StaffCriterionStat_jsp._jspService(StaffCriterionStat_jsp.java:76)
 at org.apache.jasper.runtime.HttpJspBase.service (HttpJspBase.java:70)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:717)
 at
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:374)
 ... 89 more
-----------------------------

I cannot see anything useful in this stack trace that could help me identify
the problem. Do you?

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


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