-param
/servlet
servlet-mapping
servlet-nameStrutsExample/servlet-name
url-pattern/PlutoInvoker/StrutsExamplePortlet/url-pattern
/servlet-mapping
Bruce
phillips1021 wrote:
Thanks for the quick reply. I changed:
page name=Struts Portlet Example
uri=/WEB-INF
We have a problem with using Struts 2.1.6 because we use Maven to manage our
dependencies and because we have Tomcat installed in a folder with spaces on
our development computers. This causes a problem for xWork-2.1.2 as
documented here:
Dave and Wes - Thank you both for the replies.
We can exclude the xWork 2.1.2 jar dependency from Struts 2.1.6 in our
pom.xml file for our projects as Wes suggests. However, it doesn't appear
that xWork 2.1.3 jar is available in the repository as this fails:
dependency
Wes - thanks for the feedback. I'm posting the below for others who may run
into this problem and need to get the newer version of xWork.
I checked the latest xWork source out using a subversion client
(www.collab.net). This is the command:
svn co http://svn.opensymphony.com/svn/xwork/trunk
We are moving some applications from using Struts 2.0.11 to Struts 2.1.6. In
our applications using Struts 2.0.11 we used the label tag's key attribute
to specify the name, value, label on some of our jsp view pages. So for
example:
s:label key=personBean.firstName /
would render in
I created two example applications that use Spring and Struts 2 together and
also a short presentation on how to integrate Spring with Struts 2.
See: http://tinyurl.com/bvkzu4
Bruce Phillips
University of Kansas
--
View this message in context:
The personBean's attributes are given values in an ActionSupport class.
As I mentioned using s:property value=personBean.firstName shows the
value (Bruce) correctly. This is done in the same jsp as s:label
key=personBean.firstName which doesn't show the value (Bruce) correctly
but instead
We are building a new web application that uses both JSecurity
(http://cwiki.apache.org/confluence/display/KI/Index, now known as Ki) and
Struts 2 (version 2.1.6).
In many of the JSPs for this application, we need to provide a dynamic
String value to the JSecurity tag library's hasAnyRoles
Martin thank you for the reply.
Your idea:
s:set name=roleIds value=foo1,bar1/
jsec:hasAnyRoles name=s:property value=#roleIds //jsec:hasAnyRoles
does not work with the JSecurity hasAnyRoles tag. The Struts 2 property tag
and OGNL expresson do not work when placed as the value for the name
I've done some blog articles on integrating Spring and Struts 2, which
include some example applications you may want to study if you're not
familiar with how to use these two technologies together.
See:
I've written a couple of articles on my blog about integrating Spring with
Struts 2.
See:
http://www.brucephillips.name/blog/index.cfm/2008/10/17/Using-Struts-2-and-Spring-Frameworks-Together
http://www.brucephillips.name/blog/index.cfm/2009/3/7/Using-Spring-In-A-Struts-2-Web-Application
Alee:
I just checked the link to the PDFs and they are working fine. If you
still
cannot get them to open, email me at phillips1021 at hotmail dot com and I
will send the PDFs
to you. The PDFs have the link to the source code and explain how to
build the projects.
Struts 2 has a plug
Wes
Recommend online training. I work at University of Kansas. We use Struts 2
in many of our Java web applications. I think online training would be
easier to get approved in this difficult economy.
A basic and advanced course would be good. I also think some 60-90 minute
modules on a
Nils-H (or anyone else):
I've duplicated this problem with 2.1.6 and portlets as follows:
Created a Struts 2 web/portlet application with a pom.xml having a
dependency on struts2-core-2.0.11.2.jar. Works both as a normal web
application and as a portlet application.
Changed the dependencies
Nils-H:
I created a Jira Issue (WW-3164) and attached a sample app that you can
use to duplicate the problem I'm encountering.
Bruce
Nils-Helge Garli wrote:
It would be helpful if you could create a sample app and attach it to
a JIRA issue. Then I'll have a look at it.
Nils-H
._jspx_meth_s_005ftextfield_005f0(employeeForm_jsp.java:424)
org.apache.jsp.jsp.employeeForm_jsp._jspx_meth_s_005fform_005f0(employeeForm_jsp.java:359)
org.apache.jsp.jsp.employeeForm_jsp._jspService(employeeForm_jsp.java:121)
phillips1021 wrote:
Nils-H:
I created a Jira Issue (WW
I added to the Jira bug report another example application that demonstrates
the problem. The example application is a simple Struts 2 (using 2.1.6)
application that has both normal actions and Portlet actions.
You can also download this example application (an archive of an Eclipse
Dynamic Web
Nils-H
Thank you for fixing this issue so quickly.
I was able to check out from subversion the Struts 2 trunk using
svn checkout http://svn.apache.org/repos/asf/struts/struts2/trunk
The struts2-core 2.1.8-SNAPSHOT was created by mvn install just fine.
However I got the following error
Nils-H
Ignore my previous reply. I was able to get the struts2-portlet-plugin
2.1.8-SNAPSHOT to build successfully and install into my local maven
repository.
I tested the 2.1.8-SNAPSHOT in my example applications and everything
worked very well.
Thanks again. We look forward to the
I'm learning to use the Convention Plugin.
I understand from the excellent notes posted on the Wiki
(http://cwiki.apache.org/WW/convention-plugin.html) that the plugin finds
the Action classes and maps those action classes to Action names and results
to specific JSPs. For example:
Action Class
I thought that was the case. One of the references I'm using for the
Convention plugin is the MEAP draft of Struts 2 in Practice (was sorry to
learn that the book isn't being finished, the first few chapters were
excellent).
Using the bang (!) operator doesn't work with the Convention plugin.
Someone asked me this on a different thread.
I use nabble.com (http://www.nabble.com/Struts---User-f206.html) to search,
read, post new topics, and reply to topics on the Struts user mailing list.
After I subscribed (see
http://www.nabble.com/mailing_list/MailingListOptions.jtp?forum=206) to
Rusty:
I’m also researching how to best write unit tests for Struts 2 Action
classes.
Unit testing the business logic, service classes, etc that are outside the
Struts 2 Action class is not the problem. The problem is unit testing the
Action class that requires the Struts 2 framework and
Greg:
I wish I had found your code earlier.I made a minor change as the
createActionProxy method signature your code used has been deprecated. I
added your code and a test case that uses it to my example application (see:
http://tinyurl.com/nw4jve http://tinyurl.com/nw4jve ).
Musachy:
Is the JUnit code shown in the example on the Testing Actions wiki page
missing some statements? For example I'm getting request cannot be resolved
when I copy all this code into my Java IDE.
Thanks for posting the information on the Struts 2 JUnit Plugin. I had
not heard of it
Rusty - Please post an example if you are able to use the Struts 2 JUnit
plugin.
Rusty Wright-2 wrote:
I'm going to try the StrutsTestCase in struts2-junit-plugin; it looks like
that may do the trick for me.
Thanks everyone for their feedback and links.
--
View this message in
Musachy:
I checked out the code and got my test to work when extending the
StrutsTestCase class.
The StrutsTestCase class is very easy to use and worked well. The Struts
2 JUnit plugin will be very useful. Will this plugin be part of the 2.1.8
release?
Also is it OK if I write up
a dependency in the pom.xml or include the downloaded jar in their
classpath. For now I understand they'll have to checkout the latest code
from subversion repository.
newton.dave wrote:
phillips1021 wrote:
is it OK if I write up a blog article with code example that shows
how to use
Thanks again for the information.
I wrote up a blog article that discusses how I used the new version of the
JUnit Plugin and also includes a code example readers can download.
See: http://tinyurl.com/n3hm42 http://tinyurl.com/n3hm42
Bruce
Musachy Barroso wrote:
JUnit plugin has been
Using the s:debug tag on a JSP in an application running in the Jetty servlet
container ( http://www.mortbay.org/jetty/ http://www.mortbay.org/jetty/ )
cause Jetty to throw the following exception:
org.apache.jasper.JasperException: Class:
org.apache.jasper.compiler.TagLibraryInfoImpl File:
like
to include in my article if people can expect it in 2.1.8 and be able to
just add a dependency in the pom.xml or include the downloaded jar in
their
classpath. For now I understand they'll have to checkout the latest code
from subversion repository.
newton.dave wrote:
phillips1021
I have a Struts 2 portlet application that works fine using Struts 2.0.14.
We could not get it to work using 2.1.6 and the 2.1.6 portlet plugin due to
the problem the 2.1.6 portlet plugin version had with the s:form tag (see
I changed my struts.xml configuration to use type chain instead of type
redirectAction
action name=deleteEmployee
class=com.struts2.tutorial.action.EmployeeAction method=delete
result name=success type=chainindex/result
result
Nils - I'm not following how to implement your quick fix. Do you mean I
should do this:
result name=success type=redirectAction
index.action
/result
I tried the above and it didn't work for me.
Thank you for
Nils - thanks for the assistance. I did add the .action to the actionName
and it now works in my Portlet Container (Pluto 2.0).
For example:
action name=addEmployeeSave
class=com.struts2.tutorial.action.EmployeeAction method=save
result name=success
Dan - Is your Struts 2 application using Spring? If it isn't you shouldn't
need to use the StrutsSprintTestCase (but then I don't know why you would
get the error you did).
If you are using Spring then I don't have any good advice for you as I've
not used the JUnit plugin much with a Struts 2 -
Instead of
public String getsUsername() ...
public void setsUsername(String sUsername) ...
try
public String getSUsername()... [note the capital S]
public void setSUsername()...
Struts 2 will look for and then use a set method that follows the JavaBean
convention to set the value
I did some testing also.
Using 2.1.8 with with the following:
sUsername (form field name and instance field name in the ActionSupport
class)
public String getsUsername
public void setsUsername
doesn't work as the setsUsername method doesn't get called on form
submission.
Using 2.1.6 with
I have not been able to figure out why the s:debug tag doesn't work in Jetty
but works fine in Tomcat.
Bruce
What the...
I found out about s:debug today and tried it. It worked without a hassle.
Some minutes later, I tried again and now it doesn't work on any page!
Did
Chris - I just happened to be learning Hibernate and have created an example
application that uses Struts 2, Spring, and Hibernate together.
You can download the example application here:
http://www.brucephillips.name/struts/Struts2_Spring_Hibernate_Example.zip
After you unzip the archive,
I wrote up a blog article on using Struts 2, Spring, and Hibernate together.
The article includes an example application and a list of references you can
use to learn more about these three technologies.
See:
At the University of Kansas (#1 college basketball team :) we use Struts 2
for our web application framework. Its worked very well for us.
I've been learning the Spring framework and how to use it with Struts 2. I
think the two frameworks work very well together.
I'm preparing a class for the
Thanks to everyone who has replied so far.
Your input is very valuable as we evaluate using Struts 2 and Spring
together.
Wes - thank you for the feedback on some areas of concern when using Spring.
Teaching our other Java developers how to use Spring is an issue. I do
think there are now
When we use additional Filter classes in our Struts 2 applications, we have
to put the
additional filter and filter mapping nodes before the filter and filter
mapping nodes for the
Struts 2 filter.
For example:
filter
filter-nameOpenSSODevFilter/filter-name
When we use additional Filter classes in our Struts 2 applications, we have
to put the
additional filter and filter mapping nodes before the filter and filter
mapping nodes for the
Struts 2 filter.
For example:
filter
filter-nameOpenSSODevFilter/filter-name
I've updated the tutorials at:
http://struts.apache.org/2.2.1/docs/getting-started.html
so that the Ant and Maven example projects use Struts 2.2.1 version.
Bruce
--
View this message in context:
http://old.nabble.com/Struts-Tutorials-Updated-For-Version-2.2.1-tp29449210p29449210.html
Go here:
http://struts.apache.org/2.2.1/docs/create-struts-2-web-application-with-artifacts-in-web-inf-lib-and-use-ant-to-build-the-application.html
to see a list of Jar files needed on the class path to run a Struts 2.2.1
application.
Bruce
Dave Evans-12 wrote:
On Thu, Sep 9, 2010 at
See this article:
http://www.brucephillips.name/blog/index.cfm/2010/10/3/Struts-2-Spring-Plugin--Excluding-Its-Transitive-Dependencies-To-Use-A-Newer-Version-Of-Spring
We are using the technique described above in several production web
applications without issue.
Bruce
Sparecreative wrote:
48 matches
Mail list logo