Not completely sure, but doesn't this one:
http://struts.apache.org/2.x/docs/token-session-interceptor.html
handle this situation?
developer researcher, 06-01-2011 01:55:
Hello,
I have the following problem: after submit a form, if it refresh (F5)
the page the form is submitted
Have you got this on top of JSPs?
%@ page contentType=text/html; charset=UTF-8 %
Patrick Cosmo, 15-12-2010 17:40:
Hi!
When using s:select, if the list of data returned by my java class contains strings
that have unicode characters in them, s:select fails to generate the entire tag, it
dies
Still off-topic, but recently I've been using this neat feature in GMail
where one simply grabs an actual file from, say, your desktop, and drop
it into a designated zone in the page when composing mail. The file
starts uploading when droped, so I guess you could call this ajax
upload. I
I don't know if this aplies to the issue here, but I once used this
interceptor:
interceptor-ref name=store
param name=operationModeAUTOMATIC/param
/interceptor-ref
So the errors / messages will be passed through actions and redirections
if not retrieved / showed. As far as I recall it worked
Hi,
I had the same problem, but it was time ago.
I asume from your code that you followed this:
http://displaytag.sourceforge.net/1.2/export_filter.html
and using Struts 1.
If using this with Struts2 you should have to change the url-pattern to
*.action or whatever extension you are using.
I'm using a combination of empty extension and exclusions for static
content which works well now. Got pretty confused too at beginnning when
I changed to an empty extension though:
http://struts.apache.org/2.2.1/docs/static-content.html
in web.xml:
filter
filter-namestruts2/filter-name
try it without the first /
like script src=js/util.js
Guy Thomas, 14-10-2010 14:54:
changed javascript paths as follows:
html
head
titleDomain Security Administrator: Pas gebruiker aan/title
link href=/css/domainsecurityadmin.css rel=stylesheet type=text/css
script src=/js/util.js
Why is the params-prepare-params not in the default stack / behavior
already? I think one of the first things S2 gets really useful at is the
params / prepare stuff and a LOT of people keeps asking the same
question, and getting the same answer use the params-prepare-params
stack. Any reasons
I don't have a definite answer, but just keep in mind that:
- The Dojo plugin is deprecated, you might want to consider other ways
of achieving the same thing.
- For the ajax tags to work you have to include the head tag ( sx:head/ ).
Please read:
Don't know if this solves your problem, but maybe it helps to use the
params-prepare-params trick, calling params interceptor twice, so you
have your params ready before prepare().
You have an already configured stack, the paramsPrepareParamsStack
From struts-default.xml:
!-- An example of
I think this is a browser/OS specific behaviour, not related to Struts
or even to HTML at all.
Em 26-07-2010 13:20, RogerV escreveu:
Is there a way of specifying the start directory to be used when the user
hits the browse button? As far as I can see, the system remembers where
it was looking
As far as I remember, for Struts to populate a list you just give the
same name for a setter in the action that takes a List as a parameter
as the element(s) in the Jsp. So you can have 1 textboxes *with same
name*, and if this name happens to map to a list, the list will get
populated
You can do this without parameters. Write a setter for this index
property (to save it), and then in the getter you grab the saved value.
Hi,
I want to call s:iterator and fetch a list by passing it an index. This list
will be dynamically generated.
s:iterator value=products[#index]
I've been using Tiles and always found it confusing a little bit, now
that I'm starting to test Sitemesh my vote would be for this last one.
They accomplish the same thing, only Tiles is like saying each time my
page is made up of this, this and this. Sitemesh is more about taking a
piece of a
BTW, any of those two are easily integrated into S2 as plugins (in fact
already bundled with S2 distribution, just add the jars):
http://struts.apache.org/2.1.8.1/docs/tiles-plugin.html
http://struts.apache.org/2.1.8.1/docs/sitemesh-plugin.html
I've been using Tiles and always found it
http://struts.apache.org/2.x/docs/checkboxlist.html
Hi!
Is something like the following snippet possible to do?
c:forEach items=${MyForm.list} var=entry
tr
td${entry.name}/td
td${entry.forced}/td
html:checkbox property=entry.checked /
/tr
/c:forEach
Of
If you are not using it already, I suggest using FireBug to inspect the
data sent along with each request, so maybe you can find where these
values come from.
Hi all,
I am having a strange problem with the struts2 token tag and the token-session
interceptor.
It seems like the token added to
Em 27-05-2010 11:27, Vishnu Vyasan Nelliparmbil escreveu:
Hi Guys,
I am handling a application in which we have application in two
languages. There is a Locale action for setting locale to English or
Arabic based on the parameter being passed from the respective index
pages. I.e. index_en.jsp
Em 26-05-2010 16:57, Chris Pratt escreveu:
If you search the forum, someone posted an Interceptor (quite a while ago)
that saves the Action/Field Errors/Messages in the Session so that they will
survive a redirect. It could easily be extended to do what you require.
(*Chris*)
I think this
I use to find it impossible to do this...
Then I started to use Maven, which can be used to download source code
and attach it easily. If you use Eclipse I suggest using M2Eclipse
plugin. After you get a Struts2 based project with Maven2 up and running
it should be easy to do what you want,
Hi Struts users!
I was wondering, after reading about the ServletConfigInterceptor, if
there are differences in obtaining the session map via the method
ActionContext.getContext().getSession() or have it injected through
SessionAware.
The map that I end up with is the same so... why have to
Hi,
i'm trying the append tag and the list values of the appended lists are not
showed.
This is the main part of the jsp code:
s:append var=metalBands
s:param value=%{groups}/
s:param value=%{groups1}/
/s:append
Total Bands:br
s:iterator id=band value=%{#metalBands}
Hi,
I use to do this manually with javascript, didn't know it was part of
s:form tag. So today I decided to give it a try but it is not working
for me... how does this works? Does it need some plugin or additional
config to make it work? Is it compatible with jquery, which I include in
every
Hi Thomas,
use the paramsPrepareParams interceptor stack (or change yours), from
struts-default.xml:
!-- An example of the paramsPrepareParams trick. This stack
is exactly the same as the defaultStack, except that it
includes one extra interceptor before the
Em 05-05-2010 07:57, RogerV escreveu:
So if it's looking for a string, let's make sure you're giving it one,
and not the .toString of an empty map that it got from your prepare method:
s:checkboxlist name=%{'selectedroles'} list=%{availableroles}
value=%{preselectedroles}/
I must admit I
Hi,
you can store data in session and retrieve it later on. Data stored in
session is persisted through requests.
ActionContext.getContext().getSession();
http://struts.apache.org/2.1.8.1/struts2-core/apidocs/com/opensymphony/xwork2/ActionContext.html
Hi,
I have an issue in my code that I
Maybe using OGNL along with #this or #attr . Haven't checked that out
but it should work some of these ways:
http://struts.apache.org/2.0.14/docs/ognl-basics.html
http://www.opensymphony.com/ognl/html/LanguageGuide/varref.html
Em 04-05-2010 14:03, RogerV escreveu:
Upasana Sharma wrote:
This example proved helpful to me:
http://struts2inaction.com/SimpleAjax.html
In the end I ended up doing the same with jQuery:
s:select ... onchange=
$('#divIDthatWillGetChanged').load('some.action?' + params ); /
You can get the selected option and pass as params to the called action.
:
Did you try something like this?
@RequiredStringValidator(
fieldName = label.name,
key =error.required ,
message = Name required.)}
Alex Rodriguez Lopez wrote:
Hi struts users!
I'm on my way to change from XML based validation to annotation
validation.
I've manage
If you define action alias for specific methods in your struts.xml (you
can do so with wildcards too), then you can use this format
actionClass-actionAlias-validation.xml as stated below.
http://struts.apache.org/2.1.8.1/docs/validation.html
Defining Validation Rules
Validation rules can be
Hi struts users!
I'm on my way to change from XML based validation to annotation validation.
I've manage to get it working, but (probably due to my little knowledge
of Java annotations) there are some things I can't get to work, so I
apologise if this question is not entirelly Struts related.
I'm sure your problem is related to themes/templates.
If you are using simple theme you have to provide your own labels for
fields, so the field validation works and S2 knows where to place the
messages (because you know validation happens, it's just the messages
not displaying, right?).
Hi,
you could put/get from session like so:
ActionContext.getContext().getSession();
You can define a parent action (implementing preparable) with a
prepare() method that retrieves data and store it in session for later
(and check each time if data is already in session) and puts it into
http://www.manning-sandbox.com/thread.jspa?threadID=22922start=15tstart=0
maybe this post (and the first page) will help you, as they show a
similar example and how the list relates to the properties in the action
Em 27-04-2010 14:14, RogerV escreveu:
mgainty wrote:
the site you
How I do it with selects is having getter/setter for whatever you write
in name= (in your case campus) as type Long (should be ListLong if
select is multiple). In prepare() you put in campus the campus id of the
campus that should be preselected (the one acording to the student id,
right?),
I had similar problems with labels, most times they where related to themes.
http://struts.apache.org/2.x/docs/themes-and-templates.html
For example, if you turn on simple theme you'll have to provide your own
tags for the labels as struts won't generate this markup.
Em 08-04-2010 08:18,
Hi Stéphane,
did you try implementing the Preparable interface in your action and
populating your List in the prepare() method?
http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html
Em 07-04-2010 05:16, Stephane Cosmeur escreveu:
One week later, i'm still
Use this syntax:
s:param name=directionforward/s:param
Em 07-04-2010 06:52, Supratim Bandyopadhyaya escreveu:
Greetings to all,
I have been trying to gets:url to work properly.
Here is the code.
s:url id=paginationurl action=role namespace=/role
s:param name=offset
Is the PrepareInterceptor in your interceptor stack? The prepare()
method is called by this interceptor.
Sorry if you checked already this things, it is the only that comes to
mind, otherwise it really seems like a strange behaviour.
Em 07-04-2010 09:27, Stephane Cosmeur escreveu:
Yes I
Do you have your struts.custom.i18n.resources property correctly
assigned to your bundle(s)?
Em 05-04-2010 11:27, Marc Logemann escreveu:
Hi,
imagine the following jsp (saved in UTF-8 encoding):
-- snipp ---
%@ taglib prefix=s uri=/struts-tags %
html
body
Hauptmenübr/
s:text
Try escape or escapeJavaScript atributes of s:property tag, never used
them but maybe are helpful for your situation
http://struts.apache.org/2.x/docs/property.html
Em 05-04-2010 15:06, Craig Ricciuto escreveu:
Hi there. I've run into situation that I'm not quite sure how to resolve.
In one
attribute (set it to false) and worked like a
charm.
Thanks again.
On Mon, Apr 5, 2010 at 10:14 AM, Alex Rodriguez Lopez
alo...@flordeutopia.pt wrote:
Try escape or escapeJavaScript atributes ofs:property tag, never used
them but maybe are helpful for your situation
http://struts.apache.org/2.x
Hi to all,
as I learn more things about S2 some questions emerge about best
practices more experiences users might know how to do best.
I believe it is a common problem having to populate fields like selects
first thing (with data from DB or stored in session) before any task is
done.
Thanks Zoran for sharing your approach, greatly appreciated, I'm
thinking about implementing a similar interceptor, and maybe replace the
i18n one so work is done implicitly with only a change in struts.xml and
the new interceptor.
Em 29-03-2010 02:58, Zoran Avtarovski escreveu:
Hi Guys,
We
Display tag, works like a charm:
http://displaytag.sourceforge.net/1.2/tut_basic.html
Works with lists and handles pagination, data export, I recommend it!
Em 29-03-2010 11:07, Celinio Fernandes escreveu:
Hi,
This is a classic requirement.
I have this table, in a JSP, that I have created with
04:55, Alex Rodriguez Lopez a écrit :
Thanks Zoran for sharing your approach, greatly appreciated, I'm
thinking about implementing a similar interceptor, and maybe replace
the i18n one so work is done implicitly with only a change in
struts.xml and the new interceptor.
Em 29-03-2010 02:58, Zoran
Em 29-03-2010 15:09, Celinio Fernandes escreveu:
Thanks. I already read about it but does it work well with Struts 2 ?
Yes, I'm using it with S2. Include it in JSPs like this
%@ taglib uri=http://displaytag.sf.net; prefix=display %
then, for example for a listing of users:
display:table
Hi Zoran,
would you mind sharing the code of this tag? It would be helpful to me,
as somehow I've been able to link to the same sction with an empty url
tag but unable to retain params. Thanks!
Em 24-03-2010 22:42, Zoran Avtarovski escreveu:
I wrote a small custom tag which builds the link
Hi,
don't know if it will be usefull, but some days ago someone in the user
list suggested using the getters and setters of the properties that map
to your form to call get() and put() methods of the current session (
ActionContext.getContext().getSession() ) , so you get automatic
session
Assuming your ids are of type long, you could do it with a list of Long
like so in your action:
private ListLong test = new ArrayListLong();
plus the getters and setters (getTest(), setTest()).
test is the name you gave in the select (s:select name=test ... /).
Struts2 will polulate the list
Forgot to mention, this is the case with a multiple select, if the
select is simple and only one option can be selected, then a bean
property for an int or long will sufice.
Em 23-03-2010 09:33, Alex Rodriguez Lopez escreveu:
Assuming your ids are of type long, you could do it with a list
Hi!
This might be related to the theme the form is using,
http://struts.apache.org/2.1.8.1/docs/themes-and-templates.html
This happened to me too, the default s2 theme adds table elements to
forms for layout, and trying to use fieldsets results in them being
rendered apart from the form
Hi all,
I ran into a strange error when using a checkboxlist, backed by a list
of usergroups (roles) objects. The error shows not when the form is
displayed (it all works as expected) but when submitting the form with
the checkboxes on it. Using 2.1.8.1
Could somebody please tell me if this
Solved, the list and name atributes of checkboxlist cannot have the same
name:
name=roles list=roles
this is what caused the problem.
Em 15-03-2010 13:16, Alex Rodriguez Lopez escreveu:
Hi all,
I ran into a strange error when using a checkboxlist, backed by a list
of usergroups (roles
Hi Ulf,
do you have your charset declared as utf8 like this?
%@ page contentType=text/html; charset=UTF-8%
Maybe you have to write the special characters in the string as html
entities...
Em 11-03-2010 09:10, Ulf Liedén escreveu:
Hi all,
my first post to this list :-). Sorry if I'm double
I do tend to think that the less files the better. Here it's the same
with the number of files for actions/jsp, one can use more actions, ore
less actions but more methods inside. Same with jsp, I do think it's
better with less files, but a colleague here also thinks the opposite,
sometimes
Hi!
I have the following code in a tile I use on nearly every page of my app:
s:if test=%{#request.locale.language == 'pt'}
a href=c:url value=
c:param name=request_locale
You can use hidden fields inside of the form which will be sent too on
submit as GET or POST params(usually good for IDs).
Alex
Em 05-03-2010 23:13, Adam Pinder escreveu:
Any form textfield will be submitted when page submitted which is
effectively a parameter.
Adam
On 5 Mar 2010, at 19:46,
It looks to me that you could use a combination of packages for each
store with different namespaces, but to save code repetition it would be
good idea to use wildcards (or go for the restful way as already
suggested) in the config files and later on the action retrieve the full
url to see
I'm thinking this might be related to the AJAX Theme thing... is this
required to work with AJAX validation? Any other requeriments aside from
including the sx:head tag?
Em 08-03-2010 11:11, Alex Rodriguez Lopez escreveu:
Hi!
I'm updating validations on my app to use AJAX. I followed
Em 04-03-2010 05:49, abhishek jain escreveu:
Hi friends,
I have a few variables who have diff values depending on the locale /
country.
I do want to use a message-resources for storing the values of those
varaibles,
I do not know how to get these variables in my Action (I want them in action
Em 04-03-2010 14:15, abhishek jain escreveu:
On Thu, Mar 4, 2010 at 7:30 PM, Alex Rodriguez Lopezalo...@flordeutopia.pt
wrote:
Em 04-03-2010 05:49, abhishek jain escreveu:
Hi friends,
I have a few variables who have diff values depending on the locale /
country.
I do want to use a
Em 27-02-2010 13:30, Søren Blidorf escreveu:
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
Em 28-02-2010 23:26, Frederik Minatchy escreveu:
Hello...
Since a few days I am working with Struts 2. (2.1.6)
I am facing a big problem with HttpRequest and JSPs.
Well... I have to forward a HTTPRequest from page1.jsp to page2.jsp
So... How can I pass HTTPRequest attribute betwen 2 pages?
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
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
Hi!
I've recently started a job as a webapp developer.
I've been some days already working out how Struts 2 works, I'm the kind
of person who likes to know exactly what's going on at all moments, so I
rather assemble my own app taking what I need at every moment that work
from an example.
Em 24-02-2010 16:32, Lukasz Lenart escreveu:
2010/2/24 Alex Rodriguez Lopezalo...@flordeutopia.pt:
Hi!
I've recently started a job as a webapp developer.
I've been some days already working out how Struts 2 works, I'm the kind of
person who likes to know exactly what's going on at all
68 matches
Mail list logo