Author Login
Post Reply
user Digest 27 Feb 2010 22:57:41 -0000 Issue 9014
Topics (messages 205156 through 205168):
Struts with JSF and Tiles error
205156 by: Sekar, Sowmya
Way to forcefully reload struts.xml [struts2]
205157 by: Bhaarat Sharma
205159 by: Lukasz Lenart
205161 by: Alex Rodriguez Lopez
Re: Struts2 and PlugIn interface
205158 by: Maciej Radochonski
205168 by: Pawe³ Wielgus
Re: Nabble and mailing list archives
205160 by: Alex Rodriguez Lopez
205162 by: Greg Lindholm
Re: Validation of indexed properties
205163 by: hugh111111
205164 by: hugh111111
profiling = too true
205165 by: Stephen Turner
Compiling JSP 2.1
205166 by: RobinDesHautbois
When I link to a *.do I get "Page not found"
205167 by: Søren Blidorf
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_205156.ezm (zipped)Hi,
I have an existing Struts 1 application with Tiles and JSP. I would like to use JSF 2 components instead of the JSP tags and leave the business logic and actions as is.
These are the steps I followed :
1. Copied jsf-impl , jsf-api.jar and struts-faces-1.3.8.jar in my web-inf/lib folder of my application
2. Configured the faces servlet in my web.xml
<servlet>
<servlet-name>faces</servlet-name>
<servlet-class>
javax.faces.webapp.FacesServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>/do/*</url-pattern>
</servlet-mapping>
I also configured my action servlet as follows :
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
I forwarded a menu option to a page through an action class using tiles. The target page is /faces/pages/home.jsp.
After the action is executed, it throws the following error -
WARNING: executePhase(RENDER_RESPONSE 6,
com.sun.faces.context.FacesContextImpl@(protected)
java.lang.NullPointerException at
com.sun.faces.renderkit.RenderKitImpl.createResponseWriter (
RenderKitImpl.java:183)
FacesContext is returned as null.
Please help
Sowmya Sekar

Attachment:
user_205157.ezm (zipped)We are seeing a situation where certain namespaces/actions are getting error
"There is no action mapped for namespace ... and action ..." on the server.
However, on our local we do not get this error. Which leads us to believe
that struts.xml might be getting lost.
Is there a way to forcefully reload the struts.xml?
I tried:
import
com.opensymphony.xwork2.config.ConfigurationManager;
ConfigurationManager config = new ConfigurationManager();
config.reload();
But that gives error: Could not open files of the name xwork.xml - [unknown
location]
By the way, we've noticed that when we get "There is no action mapped..."
error then the action name generally has a "!" in the URL because we are
directly going a specific method in the action.
I'd appreciate if someone can tell me how to forcefully reload struts.xml.
(Besites the struts.reload property being true in struts.xml)
Thanks

Attachment:
user_205159.ezm (zipped)2010/2/26 Bhaarat Sharma <bhaarat.s@(protected)>:
> I'd appreciate if someone can tell me how to forcefully reload struts.xml.
> (Besites the struts.reload property being true in struts.xml)
You should get rid of it, as for production environment it isn't
desired behaviour, the same with devMode
Regards
--
Łukasz
http://www.lenart.org.pl/
Kapituła Javarsovia 2010
http://javarsovia.pl

Attachment:
user_205161.ezm (zipped)Em 26-02-2010 06:06, Bhaarat Sharma escreveu:
> We are seeing a situation where certain namespaces/actions are getting error
> "There is no action mapped for namespace ... and action ..." on the server.
> However, on our local we do not get this error. Which leads us to believe
> that struts.xml might be getting lost.
>
> Is there a way to forcefully reload the struts.xml?
>
> I tried:
>
> import
com.opensymphony.xwork2.config.ConfigurationManager;
> ConfigurationManager config = new ConfigurationManager();
> config.reload();
>
>
> But that gives error: Could not open files of the name xwork.xml - [unknown
> location]
>
> By the way, we've noticed that when we get "There is no action mapped..."
> error then the action name generally has a "!" in the URL because we are
> directly going a specific method in the action.
>
> I'd appreciate if someone can tell me how to forcefully reload struts.xml.
> (Besites the struts.reload property being true in struts.xml)
>
> Thanks
>
Regarding "!" in the URL, I remember something having to do with this
struts2 propertry:
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
Check into it.
Alex Lopez.

Attachment:
user_205158.ezm (zipped)Further on the subject. For my persistence layer I use iBatis. With Struts1
I had been using plugin to load the connection object on start-up. Any
suggestion on how can I achieve similar effect with Struts2?
Thank you,
Maciej Radochonski
On Fri, Feb 19, 2010 at 3:01 PM, Maciej Radochonski
<mradochonski@(protected):
> Thanks for the answer.
>
> Maciej
>
>
> On Fri, Feb 19, 2010 at 2:53 PM, Lukasz Lenart <
> lukasz.lenart@(protected):
>
>> 2010/2/19 Maciej Radochonski <mradochonski@(protected)>:
>> > Currently I am migration one of my applications from Struts1 onto
>> Struts2. I
>> > am using several Struts1 PlugIn's (mainly for data source configuration)
>> > that are loaded on start up of the app. Could someone advise me if such
>> a
>> > functionality, or similar, is available in Struts2?
>>
>> No, use Spring, Guice or Hibernate - there are plugins to connect such
>> frameworks with Struts 2
>>
>>
>> Regards
>> --
>> Łukasz
>> http://www.lenart.org.pl/
>> Kapituła Javarsovia 2010
>> http://javarsovia.pl
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>

Attachment:
user_205168.ezm (zipped)Hi Maciej,
You can implement ServletContextListener
and register it in web.xml like this:
< listener >
< listener-class >com.ppp.oko.struts.AppListener< / listener-class >
< / listener >
just mind extra spaces i've added to xml tags.
Best greetings,
Paweł Wielgus.
2010/2/26 Maciej Radochonski <mradochonski@(protected)>:
> Further on the subject. For my persistence layer I use iBatis. With Struts1
> I had been using plugin to load the connection object on start-up. Any
> suggestion on how can I achieve similar effect with Struts2?
>
> Thank you,
> Maciej Radochonski
>
> On Fri, Feb 19, 2010 at 3:01 PM, Maciej Radochonski
> <mradochonski@(protected):
>
>> Thanks for the answer.
>>
>> Maciej
>>
>>
>> On Fri, Feb 19, 2010 at 2:53 PM, Lukasz Lenart <
>> lukasz.lenart@(protected):
>>
>>> 2010/2/19 Maciej Radochonski <mradochonski@(protected)>:
>>> > Currently I am migration one of my applications from Struts1 onto
>>> Struts2. I
>>> > am using several Struts1 PlugIn's (mainly for data source configuration)
>>> > that are loaded on start up of the app. Could someone advise me if such
>>> a
>>> > functionality, or similar, is available in Struts2?
>>>
>>> No, use Spring, Guice or Hibernate - there are plugins to connect such
>>> frameworks with Struts 2
>>>
>>>
>>> Regards
>>> --
>>> Łukasz
>>> http://www.lenart.org.pl/
>>> Kapituła Javarsovia 2010
>>> http://javarsovia.pl
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>

Attachment:
user_205160.ezm (zipped)Em 25-02-2010 18:54, Greg Lindholm escreveu:
> This mailing list on Nabble seems to be gone, at least I can't find it.
> Nabble switched over to a new system and old system is now at
> old.nabble.com but doesn't seem to be getting updates anymore.
> Anyone working to get this mailing list archived on the "New and
> Improved" nabble or is there a better place to search the mail
> archives?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
Don't know exaclty what your problem is, but I'm able to read and search
this list at:
http://www.mail-archive.com/user@(protected)/
--
Alex Lopez

Attachment:
user_205162.ezm (zipped)> http://www.mail-archive.com/user@(protected)/
Thanks that archive works fine.
Nabble must have just had a hiccup, my bookmark took me into the 'new'
nabble site where I couldn't fine anything on struts, I then found the
old.nabble.com but the struts user thread had had no updates for
several days, and was missing a post that I was trying to find to
follow up on.
I see that http://old.nabble.com/Struts---User-f206.html is now
getting updates but is still missing threads from a couple days ago.
Again, must have just been an hiccup.
On Fri, Feb 26, 2010 at 6:28 AM, Alex Rodriguez Lopez
<alopez@(protected):
> Em 25-02-2010 18:54, Greg Lindholm escreveu:
>>
>> This mailing list on Nabble seems to be gone, at least I can't find it.
>> Nabble switched over to a new system and old system is now at
>> old.nabble.com but doesn't seem to be getting updates anymore.
>> Anyone working to get this mailing list archived on the "New and
>> Improved" nabble or is there a better place to search the mail
>> archives?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>
> Don't know exaclty what your problem is, but I'm able to read and search
> this list at:
>
>
> http://www.mail-archive.com/user@(protected)/
>
> --
> Alex Lopez
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_205163.ezm (zipped)Hi Cielpa,
'Invalid property' would suggest that your form does not contain the
property searchList. It is difficult to tell without a bit of background and
seeing some code. Can you explain what you are doing and show me your
struts-config.xml file.
By the way, your form should be declared as a DynaValidatorForm. There is no
such thing as a DynaValidatorActionForm.
For example..
<form-bean name="myForm" type="org.apache.struts.action.DynaValidatorForm">
<form-property name="searchList" type="
java.util.ArrayList"/>
</form-bean>
Hugh
Cielpa wrote:
>
> Hey,
>
> I have a similar problem with DynaValidatorActionForm.
> It says that invalid property when i have a ArrayList in the
> <form-property name="searchList" type="
java.util.ArrayList"/> in the
> <form-bean declaration.
>
> Any idea?
> Thanks and your help is appreciated.
> Silpa
>
> hugh111111 wrote:
>>
>> I've got a problem relating to the validation of indexed properties in
>> Struts 1.1
>> I get the following error message when I try to access an ArrayList of
>> students in my DynaValidatorForm
>>
>> root cause
>>
>>
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
>>
java.util.ArrayList.RangeCheck(Unknown Source)
>>
java.util.ArrayList.get(Unknown Source)
>>
org.apache.struts.action.DynaActionForm.get (
DynaActionForm.java:298)
>>
>>
>>
>> Here is some background to the problem...
>>
>> In my session I have an ArrayList called studentsList of objects of type
>> experiment.mybeans.Student. A Student object has getter and setter
>> methods for id, year and gradeAverage.
>>
>> In my students.jsp I create a table by iterating through my student
>> objects like this...
>>
>> <c:forEach var="students" items="${sessionScope.group.studentsList}" >
>> <tr><td><html:text indexed="true" name="students" property="id"/></td>
>> <td><html:text indexed="true" name="students" property="year"/></td>
>> <td><html:text indexed="true" name="students"
>> property="gradeAverage"/></td></tr>
>> </c:forEach>
>>
>> As you can see the table contains empty text boxes and I would like to
>> validate these have been filled in, so in struts-config.xml I create my
>> dynavalidatorform as follows...
>>
>> <form-bean name="studentsForm"
>> type="
org.apache.struts.validator.DynaValidatorForm" >
>> <form-property name="students" type="
java.util.ArrayList" />
>> </form-bean>
>>
>> And in validation.xml I place my validation rules...
>>
>> <form name="studentsForm">
>> <field property="id" indexedListProperty="students"
>> depends="required">
>> <arg0 key="error.studentid.required"/>
>> </field>
>> <field property="year" indexedListProperty="students"
>> depends="required">
>> <arg0 key="error.studentyear.required"/>
>> </field>
>> <field property="gradeAverage" indexedListProperty="students"
>> depends="required">
>> <arg0 key="error.studentgrade.required"/>
>> </field>
>> </form>
>>
>> Now here is where things start to go a bit pear-shaped
>>
>> I have read somewhere online that I need to populate the form ArrayList
>> before I get to my jsp page. So I have created an action class called
>> PreStudentsAction.java which takes the student ArrayList out of the
>> session and assigns it to the student ArrayList in the form before
>> forwarding to the students.jsp page...
>>
>> public class PreStudentsAction extends Action{
>>
>> public ActionForward execute(ActionMapping mapping,
>> ActionForm form,
>> HttpServletRequest request,
>> HttpServletResponse response)
>> throws Exception
>> {
>>
>> DynaValidatorForm myForm = (DynaValidatorForm)form;
>> Group group = (Group)request.getSession().getAttribute("group");
>> ArrayList<Student> students = group.getStudentsList();
>>
>> myForm.set("students", students);
>> return (mapping.findForward("success"));
>> }
>>
>> }
>>
>>
>> Finally when I run my application my table is displayed but when I fill
>> in the table and press submit I get the IndexOutOfBounds error. It
>> appears to me that the student ArrayList in the form remains empty and
>> that my Action class was unsuccessful in populating the form's ArrayList.
>>
>> Can anybody see what I'm doing wrong?
>>
>>
>>
>>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_205164.ezm (zipped)Sorry Cielpa, my mistake.
Turns out there is such a thing as a DynaValidatorActionForm. Shows how much
I know.
Hugh
hugh111111 wrote:
>
> Hi Cielpa,
>
> 'Invalid property' would suggest that your form does not contain the
> property searchList. It is difficult to tell without a bit of background
> and seeing some code. Can you explain what you are doing and show me your
> struts-config.xml file.
>
> By the way, your form should be declared as a DynaValidatorForm. There is
> no such thing as a DynaValidatorActionForm.
>
> For example..
>
> <form-bean name="myForm"
> type="org.apache.struts.action.DynaValidatorForm">
> <form-property name="searchList" type="
java.util.ArrayList"/>
> </form-bean>
>
>
>
> Hugh
>
>
>
>
> Cielpa wrote:
>>
>> Hey,
>>
>> I have a similar problem with DynaValidatorActionForm.
>> It says that invalid property when i have a ArrayList in the
>> <form-property name="searchList" type="
java.util.ArrayList"/> in the
>> <form-bean declaration.
>>
>> Any idea?
>> Thanks and your help is appreciated.
>> Silpa
>>
>> hugh111111 wrote:
>>>
>>> I've got a problem relating to the validation of indexed properties in
>>> Struts 1.1
>>> I get the following error message when I try to access an ArrayList of
>>> students in my DynaValidatorForm
>>>
>>> root cause
>>>
>>>
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
>>>
java.util.ArrayList.RangeCheck(Unknown Source)
>>>
java.util.ArrayList.get(Unknown Source)
>>>
org.apache.struts.action.DynaActionForm.get (
DynaActionForm.java:298)
>>>
>>>
>>>
>>> Here is some background to the problem...
>>>
>>> In my session I have an ArrayList called studentsList of objects of type
>>> experiment.mybeans.Student. A Student object has getter and setter
>>> methods for id, year and gradeAverage.
>>>
>>> In my students.jsp I create a table by iterating through my student
>>> objects like this...
>>>
>>> <c:forEach var="students" items="${sessionScope.group.studentsList}" >
>>> <tr><td><html:text indexed="true" name="students" property="id"/></td>
>>> <td><html:text indexed="true" name="students" property="year"/></td>
>>> <td><html:text indexed="true" name="students"
>>> property="gradeAverage"/></td></tr>
>>> </c:forEach>
>>>
>>> As you can see the table contains empty text boxes and I would like to
>>> validate these have been filled in, so in struts-config.xml I create my
>>> dynavalidatorform as follows...
>>>
>>> <form-bean name="studentsForm"
>>> type="
org.apache.struts.validator.DynaValidatorForm" >
>>> <form-property name="students" type="
java.util.ArrayList" />
>>> </form-bean>
>>>
>>> And in validation.xml I place my validation rules...
>>>
>>> <form name="studentsForm">
>>> <field property="id" indexedListProperty="students"
>>> depends="required">
>>> <arg0 key="error.studentid.required"/>
>>> </field>
>>> <field property="year" indexedListProperty="students"
>>> depends="required">
>>> <arg0 key="error.studentyear.required"/>
>>> </field>
>>> <field property="gradeAverage" indexedListProperty="students"
>>> depends="required">
>>> <arg0 key="error.studentgrade.required"/>
>>> </field>
>>> </form>
>>>
>>> Now here is where things start to go a bit pear-shaped
>>>
>>> I have read somewhere online that I need to populate the form ArrayList
>>> before I get to my jsp page. So I have created an action class called
>>> PreStudentsAction.java which takes the student ArrayList out of the
>>> session and assigns it to the student ArrayList in the form before
>>> forwarding to the students.jsp page...
>>>
>>> public class PreStudentsAction extends Action{
>>>
>>> public ActionForward execute(ActionMapping mapping,
>>> ActionForm form,
>>> HttpServletRequest request,
>>> HttpServletResponse response)
>>> throws Exception
>>> {
>>>
>>> DynaValidatorForm myForm = (DynaValidatorForm)form;
>>> Group group = (Group)request.getSession().getAttribute("group");
>>> ArrayList<Student> students = group.getStudentsList();
>>>
>>> myForm.set("students", students);
>>> return (mapping.findForward("success"));
>>> }
>>>
>>> }
>>>
>>>
>>> Finally when I run my application my table is displayed but when I fill
>>> in the table and press submit I get the IndexOutOfBounds error. It
>>> appears to me that the student ArrayList in the form remains empty and
>>> that my Action class was unsuccessful in populating the form's
>>> ArrayList.
>>>
>>> Can anybody see what I'm doing wrong?
>>>
>>>
>>>
>>>
>>
>>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_205165.ezm (zipped)
Hello,
I occasionally add "?profiling=true" to a url to see which interceptors
are called on an action. All of a sudden we are seeing the interceptor
trace list in our logs for pretty much any action someone invokes in a
particular app (without the additional url param). devMode is not turned
on.
Is there an app-wide setting that would activate this profiling that we
might have turned on by mistake?
Thanks,
Steve
--
Stephen Turner
Senior Programmer/Analyst - SAIS
MIT IS&T

Attachment:
user_205166.ezm (zipped)Hello,
Any idea how to compile JSP 2.1 in Struts 1? I believe Jasper is out of the
picture... I'm not even sure where to begin looking for answers.
I'm using Jetty and we use the EL and struts tags quite a lot. A typical
example is as follows:
<logic:iterate id="selCust" name="reportForm"
property="selectedCustomerNames" indexId="index">
<bean:write name="selCust"/><c:if test="${index<sizeCust-1}">, </c:if>
</logic:iterate>
but the JSP compilation is failing, throwing the following exception:
[echo] Compile the JSP's
[javac] Compiling 362 source files to <destination path>
[javac] <path and file name>: incompatible types
[javac] found :
java.lang.Integer [javac] required:
java.lang.String [javac] String _jspx_temp0 = index;
Thanks!
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_205167.ezm (zipped)I have made a struts application and it works just fine on my testserver.
I have now uploaded it to my hosted webserver and struts does not work.
When I link to a *.do I get Page not found
Could it be a Tomcat config problem. Placing the jars and classes ect.
Struts 1.2 // Tomcat 5.5
Soren