Struts2 doesn't stop you from implementing a ServletContextListener.In
fact in the Appfuse Struts2 application there is a StartupListener (extends
ServletContextListener) that does what you talk about.
It just so happens that Appfuse also uses Spring to configure its services
including its
For sure, but since we are Java developers with a captial J, then we can call
it something other than hackfest which suits the script kitties well. ;-)
Ian Roughley wrote:
I was thinking about this myself the other day. One of the interesting
things that the ruby/rails community has
Folks, this type of nested resource is how a Rails REST url work and its
awesome. So easy to configure and so easy to use with things like
link_to :chapter_path(@book)
That will make the /book/book.getId()/chapter/chapter.getId() url. There
is no doubt that providing nested resources
It is part of the codebehind plugin, that is a dependency of appfuse.
Giovanni Azua-3 wrote:
Resolved ... in the web.xml struts filter was missing the newly required
actionPackages parameter.
Is this new to 2.1.2 or? I currently use 2.1.1 and did not have that
problem ...
regards,
s:iterator value=fruits
%
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
int monthNow = cal.get(Calendar.MONTH);
cal.setTime(date); //fruit.getDate()
int monthFruit = cal.get(Calendar.MONTH);
if(monthNow == monthFruit){
%
delete delete
%}%
/s:iterator
If you
Its is not /WEB-INF/template. Its /template under your web root.
so its /template/[theme name]/file.ftl
Struts Two wrote:
I tried the samething before but met no success as well. It would be great
if we could call a field error as follows that generate no html mark-up
s:fielderror
Do you really want them in separate packages or do you just want them in
separate directories. It seems to me that you are looking for a particular
organization of files during development, so you can keep all the like files
together. Seems reasonable enough. If that is the case then you can
The only syntax difference I see is you should put #stat.index rather than
stat.index so it looks like
s:textarea name=descList[%{#stat.index}].destination
value=%{destination} /gt;
I am assuming you have the proper setter for setDescList(ListText
descList) in your action.
BGE Ger wrote:
Don't you just overwrite the existing session values (that were left behind
because the user didn't click exit) when the user returns to the page?
You can tell the browser not to cache the page with the http equiv header
tags.
Milan Milanovic wrote:
O.K. Could you tell me very session
This doesn't seem right. How can you distinguish between something like
/book/1/customMethod and /book/1/chapter? Is it smart enough to see that
chapter is a mapped action and customMethod is not and change what it
invokes? If it works then great, but doesn't it feel like a hijack?
As I
I have found
interceptor-ref name=messages
AUTOMATIC
/interceptor-ref
to work great for addActionMessage. To tell you the truth I haven't tried
it for addActionError or fieldErrors. You would redirect after an error
that should render input?
Yes.
Milan Milanovic wrote:
O.K. Thank you.
Should getExpired() method return boolean ?
--
Thx, Milan
dusty wrote:
s:iterator value=fruits
%
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
int monthNow = cal.get(Calendar.MONTH);
cal.setTime(date
So what the others are saying is that you should NEVER use chopsticks when
you are eating soup
No just kidding. Depending on what version of struts you are using you
likely need a
s:set name=listOfEmployee value=listOfEmployee/ before the display
tag.
Otherwise your decorator could be
I think you need to post the relevant section from struts.xml so we can see
how you declare the action as well as your spring configuration files.
-D
Miguel-55 wrote:
Well, the question is if you are using Spring 1.x or 2.x and creating
spring beans (using the spring plugin and in your
This is kind of a wild guess, but it sounds like you are having problems with
keeping a connection open to the database. Maybe its a MySQL database
connection that goes idle and closes but the pool thinks its still open. It
happens... Anyways so what if the following happened...
1) You app
So it would appear that your servlet engine is also serving as your primary
HTTP stack? running on port 80? If you ran Apache on port 80 instead and
used ajp-proxy for your struts requests, then you could just serve all your
static resources directly from apache.
Now, if you want an
So does anyone have an example of the configuration needed to make the
Convention and REST plugins work together. I know musachy had made some
changes to make this possible, but when I just include Convention in the
pom.xml, strange things happen.
Is there a set of steps get it configured
Can you describe what you are doing in the Action and on the page a little
bit more?
It seems like you are trying to resolve if the portfolio is new or not.
Where in your action do you load up the portfolio object? Are you familar
with the Preparable interface for your actions?
What does your
if you are using jsp why not use the jstl tag? The valueStack values are
accessible in JSTL.
nestorjb wrote:
Hi
Isnt there a way to apply formatting of number and dates in Struts 2 at
the
JSP level?. I need to conditionally format a number depending on a
condition. Isnt there an
Struts2 is only part of the equation for your new application. If you are
just starting out, I suggest taking a look at Appfuse and using their struts
starter application. You an walk through the tutorials and get some source
code that will help you navigate through things like Hibernate,
I am using the 2.1.3-SNAPSHOT of Struts2 with the SiteMesh JSP PageFilter. I
have found that the struts tags do not error out in the JSP decorator but
they also cannot find any values (stack, session, etc). They just return
blank.
I would use the struts2-sitemesh-plugin, but I would like to
/
to the decorator, main.jsp. The message was not rendered. When I moved the
s:actionmessage/ to listActions.jsp (content page) it is rendered.
Musachy Barroso wrote:
Is that any different form the configuration in showcase?
musachy
On Mon, Nov 24, 2008 at 1:38 PM, dusty [EMAIL PROTECTED
setup which I think still
works.
dusty wrote:
No it is the same as the showcase and it behaves this way as well. The
only struts tags in the decorator in showcase are s:url with a hard value
attribute, so they are not accessing the session or stack (I think).
I added an addActionMessage
There is built in data conversion, but you have to create your own data
converter.
Struts could't automaticaly find your State from the id since it knows
nothing a about your persiatance layer. So you will have to look it up in
the converter. For some as simple as the State object you have,
I use 2.1.3-SNAPSHOT with JQuery without issue. Just don't include the
plugin. Are you by chance using another framework like Appfuse with Struts?
newton.dave wrote:
--- On Wed, 12/3/08, Danilo Barsotti [EMAIL PROTECTED] wrote:
I use jquery framework and I need to turn off dojo because
You may want to look at the ActionMapper interface.
See here
http://www.nabble.com/URL-Mapper-Best-Pracitices-Question-td19523090.html#a19533299
Jeremy's response
and here:
http://www.nabble.com/Custom-URL-in-Struts-2-td12160278.html#a12166651
talks about the difference between
+1 on SessionAware. It doesn't get much easier than:
public void setSession(MapString, Object stringObjectMap) {
}
to mock for testing.
Session use as a design pattern is a different issue. Struts2's conversion
and parameter handling makes it pretty easy to make each transaction as
This is a fairly common issue. I don't have time right now but if no one
shows you I can show you tonight. It is a combination of type conversion
and the prepare filter depending on your requirements. If you want to try
to figure it out on your own in the meantime, look at the type conversion
you want to use the class name rather property name on your conversion file.
com.mydomain.model.Artist=com.mydomain.converter.ArtistConverter
You specify the property name when telling struts the Bean type for an
entire collection. I don't think you can register Type Converters for a
. The string representation of your bean is its id and then you
can use that in the type converter to look it up from the database and put
the actual full bean in the model's property.
dusty wrote:
This is a fairly common issue. I don't have time right now but if no one
shows you I can show
Hello,
This vexed me, so I thought I would share to help anyone stuck with
something similar
I have Spring Security protecting my Struts2 app. Originally I had my
filters setup like this:
filter-mapping
filter-namestruts-prepare/filter-name
url-pattern/*/url-pattern
I think you can use the top keyword to jump out to the 1st level.
List 1
--List 2
List 3
s:property value=top.list3/ I don't remember if you need a # in front
like this #top.
laes1 wrote:
Hello
i have an anction form , where i declared two liste
list1 and list2
to loop through
Wes, you are my hero. And besides, Cold Fusion is making a huge come back
and is slated to take over for JSF.
Wes Wannemacher wrote:
On Tue, 2009-01-13 at 17:03 -0500, Musachy Barroso wrote:
On Tue, Jan 13, 2009 at 3:48 PM, SanJ.SANJAY girish...@gmail.com wrote:
spring-Hibernate/JSF.
Once you use the s:url tag, you can use JSTL syntax.
${myaction} ...
In fact I have started a meme where I create a routes.jsp that I include in
my files that lists all the s:url and other useful url aliases like s:url
value=/resources id=resources/
${resources}/images/bla.gif
I have
Are you open to using s:textbox and JQuery to make this work rather than the
Struts widget?
Richa Pandharikar-2 wrote:
Has anyone got the datetimepicker working with Tiles?
- Richa
-Original Message-
From: Richa Pandharikar [mailto:richa.pandhari...@tdktech.com]
Sent:
First of all this is the third time I have tried to respond as I keep trying
to use ctrl+W to select a word while editing in this text area and closing
the browser tab. (IDEA muscle memory).
Ok, so my first question is why have a Search action and then a separate
SearchResults action? What
If you have the action can you use Reflection to step through the properties
and find the types that way?
Torsten Krah wrote:
I want to customize the conversion error messages to be more special in
cases
of wrong types.
Using a custom interceptor this is possible to do but lets say the
You can de-autowire an action by creating an XML configuration for it.
Then you can use the spring name instead of the class in the action config
bean id=myAction class=com.actions.MyAction
property name=myManager ref=userService/
/bean
bean id=myOtherAction class=com.actions.MyAction
The short answer is no. You can create a custom ActionMapper to tell Struts
how you want URLs parsed and how you want Actions invoked.
There has been a lot of discussion about extended properties and custom
ActionMappers in previous discussions. See if you can find enough
information there
Check out this discussion:
http://www.nabble.com/REST-plugin-URL-syntax-td17855192i20.html
and this link:
http://www.blueskyminds.com.au/url-hierarchy/
dusty wrote:
The short answer is no. You can create a custom ActionMapper to tell
Struts how you want URLs parsed and how you want
Allowing a user to login again to a different ID using the same session is a
FAIL.
It is not really a S2 issue, but an authentication implementation issue. It
is true that S2 does not provide a default authentication/authorization
implementation, but Spring Security does the job very well.
So, your form posts via AJAX to the action and the results sent as (JSON,
XML, HTML) and rendered via Javascript on some div on the page?
If that is the case then you do indeed have a problem. One easy fix is to
use an actual list page rather than rendering the list via Javascript. But
if that
Conversations are just state persisted over a session. They could be used
for long transactions, wizards, etc. The issue that you may lose track of
that state for a user if another user hijacks the session is not a use case
for a feature but a description of a bug.
Creating a separate
independent of http session feature without any baggage and
which they claim as revolutionary approach to state management. I will
check this feature.
Regards
Rajib
dusty wrote:
Conversations are just state persisted over a session. They could be
used for long
Do not use s:form action=/j_security_check use a normal form
action=/j_security_check
I think you could also do a
s:url value=/j_security_check id=loginPost/
s:form action=%{#loginPost}
Raghuveer Rawat-2 wrote:
Hi, I am trying to setup my struts2 login form for spring security..
I
I have not researched this butthe way I understand it the action is
executed and its result evaluated and that result sent in place. You can
choose not to execute the result but then it just does something and the
view moves on. When you are doing s:action/ you are at the view stage
right?
Anyone seen this in Tomcat?
Wolfgang Knauf wrote:
Hi all,
I have a quite small Struts 2 application running on a JBoss 5.0GA.
It contains some EJB3 entity beans, an EJB3 session bean, a handful of
struts actions and three JSPs.
After about 5 redeploys (I use JSR88), JBoss is
Sorry. I don't think I understand your problem. When you say the stack is
being cleared are you seeing nulls in your converter for values that were
previously populated on the stack by the Parameters Interceptor?
Andrei Ivanov-2 wrote:
On Sat, Jan 17, 2009 at 7:30 PM, Andrei Ivanov
Has either of you tried the XSLT result type? I have not and I am curious
about how well it works.
aum strut wrote:
Thanks Musachy for the help
i will try to follow what u have suggested
On 1/19/09, Musachy Barroso musa...@gmail.com wrote:
Take a look at the results, they are
So, when you write s:hidden name=backendsystems/ you are asking Struts to
convert your list to a string and represent it like:
input type=hidden value=StringRepresentationofList/ and I am not sure
that is what you want. Because when you resubmit that String struts is not
really sure how to
In your action method use addActionMessage. Then in the jsp page use
s:actionmessage/ to display the message(s) in the list.
You will be using the MessageStoreInterceptor. If you are using 2.1.6 make
sure the store interceptor is in your stack in struts.xml. If you are
using an earlier
Good luck with SEAM.
RajibJana wrote:
I strongly feel that this should be a feature of S2, it will ease the
developers work. With due respect to S2, I can say that SEAM provides few
more relevant features that are required for todays enterprise
applications.
Thanks
Rajib
I have used the static method you describe in the past.
Ignacio de Córdoba wrote:
Hi there,
I am writing a custom authentication and authorization interceptor and
need access to cookies. I've checked in Struts2 and other docs both ways
of getting access to cookies. I can't use
When using the struts2-spring-plugin, without bean declaration for your
actions, what is the default scope for the created Action beans? Prototype,
I hope, but I can't really find where that is set or happens. I know the
default for Spring beans when not otherwise specified is Singleton, so I
Lukasz Lenart wrote:
2009/1/26 dusty dustin_pea...@yahoo.com:
When using the struts2-spring-plugin, without bean declaration for your
actions, what is the default scope for the created Action beans?
Prototype,
I hope, but I can't really find where that is set or happens. I know
intended
recipient. Sender does not necessarily endorse content contained within
this transmission.
Date: Mon, 26 Jan 2009 21:41:21 +0100
Subject: Re: Spring Scope Default
From: lukasz.len...@googlemail.com
To: user@struts.apache.org
2009/1/26 dusty dustin_pea...@yahoo.com:
Interesting
Next week on When Dave Snaps, he threatens to ban anyone from the list if
he finds the answer in the first five links returned from googling 3 or more
words in their post.
...do the needful -- priceless.
newton.dave wrote:
Wes Wannemacher wrote:
On Monday 26 January 2009 22:34:57 Dave
mvn dependency:tree | grep spring
spring-framework-xxx:2.0.5
spring-framework-xxx:2.5.6 -- oh #@!
dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-spring-plugin/artifactId
version2.0.11.2/version
excludes
exclude
+1 for @Namespace(/webfarm)
chaining is usually a sign of a bad pattern. See
http://cwiki.apache.org/confluence/display/WW/Action+Chaining.
Those are class annotations I assume. Any errors on application startup?
Including the convention plugin does help it work.
newton.dave wrote:
That is too bad. Injecting a Resource in Spring is a snap and you can do
cool things like load from the classpath when testing but then load from the
file system during runtime. You can store your parameters in a properties
file and then load that file into a Properties object.
Bummer your
You are likely using a full interceptor stack that includes the FileUpload
interceptor. You should be able to exclude that interceptor from your stack
to remove that dependency.
ManiKanta G-2 wrote:
http://struts.apache.org/2.x/docs/file-upload.html
Well I m not using any file upload...
List = ResultSet from Oracle. If you can project your resultset into Objects
then you can address properties in the jasper report by fieldName. To be
perfectly honest it has been a while since I have worked with raw JDBC
objects, so I cannot remember what object you create to execute SQL to
You should look at Spring annotations. So awesome. And Spring Security!?!
forget about it. If you don't drink the Injection/TDD koolaid then wiring
up services with Spring may seem lame.
I don't think the issue is how well Spring handles JDBC. We could talk
about Hibernate, but I am
Well, I have been using the underlying DefaultTypeConverter for a while
across various versions without any problems. The StrutsTypeConverter is
really just a convienence class to abstract you from the XWork converter,
but there is no reason why you can't just use the XWork converter.
Here are
Are those nested s:url tags? impressive.
$(document).ready(function(){
$(#reallyLongLink).click(function(){
//and to integrate with Struts2
alert('s:property value=#tempMilestoneRemoveURL/');
});
});
newton.dave wrote:
Seshagiri V wrote:
Sorry,
What is your filter order in web.xml. Can you show your web.xml config?
dubrovsky wrote:
I posted reply for this problem in Spring community forum. Who is
interested in, please follow the link -
http://forum.springsource.org/showthread.php?t=66381
Dude. I read somewhere that IE sucks at handling URL encoding that uses +.
You may need to google that or experiment with %20 instead. %20 is space
right?
Seshagiri V wrote:
FIY
..
In Firefox, selecting text(as # only If click on Delete link
as button then
and Struts and watch the request to see what changes made in Spring
Security are affecting the Struts interceptors.
dubrovsky wrote:
dusty wrote:
What is your filter order in web.xml. Can you show your web.xml config?
Yes, of course. I think my web.xml is all right. Here
Here is a Calendar converter class. Modify as necessary for your calendar
object:
import ognl.DefaultTypeConverter;
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang.time.FastDateFormat;
import org.apache.commons.logging.Log;
import
to a date object and use the struts
tag to format my date:
s:iterator value=scheduleList status=scheduleStatus
s:date value=scheduleList[#scheduleStatus.index]
format=dd/MM//
/s:iterator
dusty wrote:
Here is a Calendar converter class. Modify as necessary for your
+1 Spring Security. Everything else is for wimps.
Wes Wannemacher wrote:
On Wednesday 04 February 2009 05:56:24 alee amin wrote:
I browsed through struts official site to check for any plugin available
or
security mechanism to authenticate the user. but i could not find one.
can
You can't do what you are doing exactly. When you are using the free
conversion, Struts2 needs to be able to construct your object with a default
constructor and that is not going to happen with an interface. So if you
want to dynamically determine the implementation of that Object at runtime
mvn -Dtest=MyTestClassName
But don't let that think you can get Maven answers here! ;-)
Nils-Helge Garli wrote:
As both Martin and Dave pointed out, this is a maven related question.
Please check here: http://maven.apache.org/users/getting-help.html
Nils-H
On Fri, Mar 6, 2009 at
Hi All (err Musachy),
I have the classes below that I use for unit testing. They are a
spin-off/update of the Depressed Programmers unit test class. I like them
because they can test the Struts config along with the actions themselves +
interceptor execution. Things go well when you have an
The [] syntax is used to define collections or maps of values. I don't
think your setters are going to work that way. OGNL does not know how to
handle arbitrary new setter parameters.
I think what you are trying to do is create a form with an arbitrary number
of fields, probably driven from
Adding the action, namespace and params url constructing pieces to s:a would
be cool, as long as we don't nerf the s:url function. I rather like the
pattern of using a central routes page as an include where urls are
created and their ids referenced in links via JSTL in the main pages.
-D
Sorry Martin, did Dave answer your question? Were you just wondering about
the namespace parameter on the url tag or about the routes pattern in
general?
mgainty wrote:
can you explain this routes a bit more..what is this another attribute or
a template?
i can see see action, params but
Sorry it took me a while. Damn flu season...
Anyways, its not really complicated but I have found it to be useful. It
was inspired from some RoR projects I worked on and is a poor mans routing
table.
You create a JSP that you will include at the top of all your JSP views. In
this JSP you add
@Chris - Those are definitely good points. I think that our first priorities
for the applications we build for the Health System are maintainability
readability. We don't have the performance needs of a major public internet
site. Our sites are pretty zippy. ;-) Usually we have more large
This is a gift from Mr. Don Brown back when he was working on the REST
plugin. I remember people asking for it. Speaking of mrdon, where's he
been? Maybe Atlassian is working him hard these days. ;-p
Musachy Barroso wrote:
It is not a bug, it is a feature! /friday
musachy
On Fri,
your syntax for the field name should be
...name = settings[] rather than name = settings()
Also, I think your action expects to build a List of Settings rather than
Map of settings. If that is the case then you don't want to use key values
in settings[ASDF1-123AS-123SA-123] you want to use
Are you just looking for a Struts2 convention or the whole stack, presumably
Spring/Guice Hibernate/JDBC?
sheltonn wrote:
I was looking for something akin to the java code convention standard
(http://java.sun.com/docs/codeconv/). My guess is that there is nothing
out there for that. My
Not really. I am not sure if there is a Struts2 question in there or more of
a general web application design question. It sounds kind of messy. Kind
of a poor man's mash-up. Why do all the applications have the same session
id? Is it all one app now on one server or are they still on other
I am not sure it helps you with Dojo, but may want to look at either a) the
JSON result plugin which will return the actionErrors as part of the object
graph. You could also create your own objects and have the plugin encode
those in JSON and process them on the client side. b) I vaguely
Yes, I remember talking to Don about it at last year's Java Symposium. The
only exception is that RoR routes allow nested resources and provides not
only controller/action mapping but also outbound link generation.
To tell you the truth, I am big believer in the RESTful design concept for
There should be a rule:
If you can't write it by hand, then you shouldn't use a tag to automate
it.
This goes triple for Javascript. Once things start emitting Javascript, if
you don't know what they are doing and why, you are headed for trouble.
Look at the Dojo questions in the mailing
Ultimately, we should declare what are resources and get the free mapping
from the REST plugin for those Controllers. Seems like that is what the
NamspaceBasedActionMapper is, but I was thinking either a
@Resource annotation at the top of the Controller
or
constant name=struts.rest.resources
You don't need to rebuild Struts to customize the freemarker templates. Put
a folder called /template in your webroot and then subfolder of the theme,
like simple. /template/simple/doubleselect.ftl or
/template/xhtml/doubleselect.ftl.
newton.dave wrote:
sajidbigler wrote:
i am
I demand a new Rabile post that declares Struts2 no longer sucks.
Musachy Barroso wrote:
yeah I was thinking about that when I was writing that email, you out
there Matt? :)
musachy
On Fri, Mar 20, 2009 at 10:23 AM, Dave Newton newton.d...@yahoo.com
wrote:
Musachy Barroso wrote:
Seems like you have it down. Why is it kind of? It is only a really type
conversion issue if you need to reconstruct the graph of MapBeanList from
a string posted from a web page.
mahanare wrote:
kind of got a fix.
here is my jsp content.
tr
s:iterator
displayTag is not terrible when working with Struts propertiesthese days.
Remember that you can get to stuff on the value stack via JSTL expressions
as well. Which works well with displayTag.
Mileidys Gonzalez Prieto wrote:
I recomend jMesa... is very good and is possible to do
GUICE usage is strictly forbidden.
Adam Ruggles wrote:
If you're using spring, why don't you use spring to inject your property?
Kumar Mettu wrote:
Musachy,
This works great as long as default Struts Object Factory is used but
get the exception the following exception If I
I am not sure that I understand your problem if there is one.
---
I have that shirt
Patrick Aikens wrote:
I'm trying to go with an all-annotation based configuration for a
project I'm working on, and now have the desire to use a scope
interceptor in my app. The following is an
Back in December Blake was asking about reloading the config using JavaRebel.
Does anyone have any experience with this working? They are advertising
Works great with Struts2 on their website. I was going to give it a try
but wanted to know if anyone already did some debug lifting.
--
View
Seems like it should work the way you have it described. Perhaps show the
JSP syntax although is suspect its correct. Maybe also show the Bean and
action code for good measure.
Is days a reserved word in OGNL? I don't think so. Did you try to change
it to dayz and see if that works?
Is that an ad for services? Maybe proof read if so, but better yet
ask/answer questions.
Frans Thamura-2 wrote:
hi all
just wanna to give u all our work
my foundation, meruvian, now collect and helping vocational school,
and mostly 50% cannot work, and they are smart
take a look,
The common pattern suggested for this requirement is to create interceptors
to decode the values coming in and a jsp library/tag to encode the values in
the link.
PEGASUS84 wrote:
Thank you.
i wish encode data in the query string how can I do?
--
View this message in context:
to watch the video when I
fire up my laptop later.
-Wes
On 4/6/09, dusty dustin_pea...@yahoo.com wrote:
Is that an ad for services? Maybe proof read if so, but better yet
ask/answer questions.
Frans Thamura-2 wrote:
hi all
just wanna to give u all our work
my foundation
country. I plan to watch the video when I
fire up my laptop later.
-Wes
On 4/6/09, dusty dustin_pea...@yahoo.com wrote:
Is that an ad for services? Maybe proof read if so, but better yet
ask/answer questions.
Frans Thamura-2 wrote:
hi all
just wanna to give u all our work
my
Nice! I thnk I will definitely give it a try. Seems like are always
building something, we build a lot of smallish apps for the health system.
Is it in the sandbox? I haven't looked for it.
krosenvold wrote:
dusty wrote:
Back in December Blake was asking about reloading the config
1 - 100 of 149 matches
Mail list logo