possible without the
use of JavaScript?
On Sun, Mar 1, 2009 at 8:52 AM, Dave Newton wrote:
> Zarar Siddiqi wrote:
>>
>> submits a . If you want your two submit buttons
>> to call two different actions, you'll need two different forms.
>
> can submit to different
submits a . If you want your two submit buttons
to call two different actions, you'll need two different forms.
If you can't do that then you could have an onclick handler for both
the submit buttons and depending on which one the user clicks, you can
change the action value of the form ().
Zar
If your actions are extending ActionSupport than you can go like so:
public String intercept(ActionInvocation invocation) throws Exception {
String message = ((ActionSupport)
invocation.getAction()).getText("resource.key")
...
}
Zarar
On Thu, Feb 26, 2009 at 12:23 PM, Security M
I can't believe I haven't run into this issue before but I just noticed that
you can't use JSP 2.0 syntax inside a Sitemesh decorator.
My Sitemesh config is exactly like as described here:
http://struts.apache.org/2.x/docs/sitemesh-plugin.html
The only difference is that I'm using PageFilter ins
Well, you could just use the pageContext variable to get the query string
like so:
${pageContext.request.queryString}
Zarar
strutstwouser wrote:
>
> Hi,
>
> I need to access certain url parameters and pass them on as the query
> string
> to an iframe within the jsp
>
> So, if the incoming
A much easier way to do this would be to apply a CSS style like this:
div.wwgrp br {
display: none;
}
See this old blog post:
http://arsenalist.com/2007/04/11/struts-2-form-control-templates/
On Dec 5, 2007 9:14 AM, Angel Gruev <[EMAIL PROTECTED]> wrote:
> Thank you both for the quick respo
Make sure that you have a property called struts.custom.i18n.resources
defined in struts.properties which refers to the resource bundles that
you're using. For example:
struts.custom.i18n.resources=resource1,resource2
The above would look for resource bundles called resource1.properties
and reso
Problems that I see:
1. Spring bean is defined as "helloWorld" but referred to as
"HelloWorld" in Struts config (case is incorrect).
2. You're saying that your action class is under src/action so I would
think the fully qualified name of the class might be
action.HelloWorldAction but that's now h
Try putting the redirect="true" on the global forward instead of the
action forward like this:
The rest seems OK.
Zarar
On 10/17/07, Srhan <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I've web.xml file in which I've index.jsp as my welcome files list.
>
> index.jsp
>
Looks like you need a dose of ServletActionContext:
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/ServletActionContext.html
Zarar
On 10/11/07, Adam Hardy <[EMAIL PROTECTED]> wrote:
> I'm writing a few static methods to use as taglib functions in my JSPs, in
> particular r
I thought you could only specify properties files for action beans,
not model ones. So in your case try specifying
PersonneFilterAction.properties
Zarar
On 10/8/07, pilou <[EMAIL PROTECTED]> wrote:
>
> hi
> I noticed that the property bundles named with the Model Bean class name
> does not seem
Well, a couple things pop into one's mind:
1. Why are you using the @SkipValidation on the execute() method, this
is telling Struts NOT to validate calls to this action.
2. Your action is called teste.do which is a little fishy because
usually the extension (.do) doesn't need to be specified in th
I load it using the following:
<#assign s=JspTaglibs["/struts-tags"]>
You'll also need to load the JspSupportServlet:
JspSupportServlet
org.apache.struts2.views.JspSupportServlet
1
Look at the section called "Tag Support" here:
http://struts.apache.o
Yeah, you're going to have to load them every time. You could store
the collections in session or application scope if that's feasible but
other than that you don't really have a choice. Alternately, I think
the cleanest way of doing this might be to make an Ajax call to load
the third selection
I think the Zero Configuration idea is a nice idea but the
implementation is far from sufficient and will probably get better
over time (hopefully). The problem mainly is with the limit of
annotations. There are things that can be represented in struts.xml
that have no chance of being represente
my
Struts apps I use Prototype/Scriptaculous for the Ajaxy features, I
don't see anything wrong with that. Besides, Prototype is
lightweight, easy-to-use, tested and has excellent documentation,
hence the suggestion.
Zarar
On 9/29/07, Oleg Mikheev <[EMAIL PROTECTED]> wrote:
> Zarar Sid
If you're using Spring you could define your action bean as a
singleton and that would do the trick since the same instance would
always be reused. Note that this is pretty crazy in most cases,
you're probably better off storing our objects in session scope like
Chris suggested.
Zarar
On 9/29/07
ActionContext.name")
But you're right in if what you're looking for is stored in some place
other than the context then it seems difficult to retrieve it using
JSP.
On 9/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Yes, but how does solve this problem?
>
&
I really recommend using something like Prototype to do your Ajax
stuff. There's no need to reinvent the wheel and introduce countless
bugs in the process, Prototype is tested for all relevant browsers and
it'll take you 10 minutes to do what you're trying to do if you use
it:
http://www.prototyp
Am I crazy or is Jennie using Struts 1.x and Mark just proposed a
solution for 2.x?
Jennie, your web.xml servler-mapping is overriding each other, you're
first saying you want /*/*.jsp sent to action but then you're saying
you want *.do's sent to action? I'm not too sure if that's valid.
Have you
Did you know you have all the variables declared in this class as
public static final at your disposal:
http://svn.apache.org/viewvc/struts/struts2/tags/STRUTS_2_0_9/core/src/main/java/org/apache/struts2/views/util/ContextUtil.java?revision=558805&view=markup
They include "stack"and "ognl".
Zara
It's been a while since I've used Struts 1.x but did you try using
to set a variable and them dump it in cssStyle using ${}
syntax? If not that, you could always add the CSS class to the input
field using JavaScript.
Zarar
On 9/28/07, prem_gadgetquest <[EMAIL PROTECTED]> wrote:
>
> I have lots
I'm not sure what you want to do with the FreemarkerManager instance
but if you're looking to do things like build results
programmatically, my posting where I answered my own question on the
Freemarker User list might be helpful:
http://www.nabble.com/forum/ViewPost.jtp?post=12740736&framed=y
If
Zarar
On 9/6/07, Adam Hardy <[EMAIL PROTECTED]> wrote:
> I am using struts tags for the first time in a JSP with S2 and I haven't found
> what I'm looking for so I guess it's not available, but could I just check for
> certain?
>
> I want to put a string into a button using an i18n bundle. I tr
Freemarker variables using
the $ or # syntax, you should probably do an if check like this:
<# if myActionProperty.subProperty?exists>
${myActionProperty.subProperty}
I know, it's a bit of a pain.
Zarar Siddiqi
On 9/6/07, Kenton <[EMAIL PROTECTED]> wrote:
>
> I'm
Try this guy:
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/ServletActionContext.html
stanlick wrote:
>
> I have an action that determines the requester IP address. The action
> implements ServletRequestAware, but I don't like it being all tangled up
> in the Servlet
The struts.configuration.files property in struts.properties at the
root of your classpath can specify struts configuration files using a
comma separated list, by default this property is set to:
struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml
You can change it if you l
nd the
> action info in ActionProxy.
> Now I can load the collections base on method and result type :)
> Thanks for your help.
>
> Regards,
> Boon Leng
>
>
> Zarar Siddiqi wrote:
> >
> > You could implement Preparable and load countryOptions in the prepare()
You could implement Preparable and load countryOptions in the prepare() method.
http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html
Zarar
On 8/20/07, Boon Leng <[EMAIL PROTECTED]> wrote:
>
> In my form, I have a select box which get the option value populate
If you're using Spring, it's probably a great idea to use Acegi
Security to handle authentication/authorization. I can't think of
anything it can't do.
http://www.acegisecurity.org/
There's also Berkano which doesn't do nearly as much as Acegi but can
handle most general AA problems:
http://ber
Struts isn't catching this exception because you're throwing it in a
JSP page which is being accessed outside the Struts servlet (directly
via a URL).
Try throwing the exception in a Struts action and see what happens.
But even if you do that you'll run into a problem with the current
setup. You'
Specify your validation rules in a file called
MyActionClass-myAction-validation.xml where MyActionClass is the
action class and myAction is the name of the action being executed.
So your struts.xml would look something like:
...
With this setup the validation in
MyActionClass-myAction-validation
> Well, if your Action class implements TextProvider (as does
> ActionSupport), then you can resolve keys any way you'd like. As for
> plugging/altering the existing lookup that is used by ActionSupport,
> it really isn't possible right now, and I've love to see a patch
> making that more flexible
Why can't you access the HttpServletRequest object using
ServletActionContext.getRequest() and then just use the getParameter()
method to get the request parameters?
If you're getting a ClassCastException it's because you're casting
something that isn't a String to a String. Find out what the typ
The same way you would get a textfields. If your select box can allow
for multiple selections, declare a String[] array in your action class
and the selected values will map to it. Don't forget the getter and
setters.
Zarar
On 8/3/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote:
> Hi again,
>
That magic starts happening in
http://struts.apache.org/2.0.8/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html
ParametersInterceptor . Take a look at the javadocs and source to see how
its done. You could then extend the class or write a new interceptor which
This is more a displaytag question than a Struts one really but make sure
you have the IText jar in your classpath and that you've setup your
displaytag filter correctly (which should be the case since your other
exports are working)
Zarar
abhi_kaul wrote:
>
> Hi!
> I am using display table
If you're just trying to get the context path, you can just use
${pageContext.request.contextPath}. That way you can just write:
If you're using Freemarker, its even easier, just use ${base} like this:
You can't just specify "css/myStyles.css" as the value of the href tag as
that will be in
The only mysterious part here is figuring out why you would want to use ! in
your action name. The default behavior of Struts 2 is for the URL
http://localhost:8080/actionName!myMethod.action to actually execute
myMethod instead of execute() when the action is called so you don't need to
make you
That'll work but if you want to use one line to get it, use this:
http://www.springframework.org/docs/api/org/springframework/web/context/support/WebApplicationContextUtils.html#getRequiredWebApplicationContext(javax.servlet.ServletContext)
WebApplicationContextUtils.getRequiredWebApplicationCont
You might want to post your JSP code. But I thinks specifying the
'template' and 'theme' attributes of your JSP tag should do the trick. I
blogged about this a while back:
http://arsenalist.com/2007/04/11/struts-2-form-control-templates/
Also make sure that when you extract your template/theme
It sounds to me like your Action class might be configured as a singleton.
If that's the case the action class' constructor would only be called once
on startup. Make sure you have singleton="false" in your Spring config for
the action class. The default value for singleton is true.
stanlick
I've just added a few links to the Wiki that show how to deal with some
common issues when using Struts.
Unit Testing
http://arsenalist.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/
Validation
http://arsenalist.com/2007/05/10/struts-2-validation-using-annotations/
Zero Configuratio
Have you tried storing it in a variable using using and having
escapeXml="false" and then putting that variable inside the value attribute
of the tag?
- Original Message -
From: "lk" <[EMAIL PROTECTED]>
To:
Sent: Thursday, July 21, 2005 12:40 PM
Subject: How to put the sumbol ′ int
I think the ideal that you're searching for is "one class per view". Take a
look at JSF.
- Original Message -
From: "Schaub, Stephen" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List"
Sent: Monday, July 11, 2005 3:56 PM
Subject: RE: Putting execute() in ActionForm
Rick Reumann
The trouble is that you're not saying much.
- Original Message -
From: "Mariano Petrakovsky" <[EMAIL PROTECTED]>
To: "Lista de correo de Struts"
Sent: Monday, July 11, 2005 2:26 PM
Subject: I can't initialize de Serlvet Action :(
Throw an exception ServletAction can't load...
In
Wel, I catually have something like form.cards[0].cardNumber, but it is
also not an array. It is a collection.
Doesn't matter, it works for both as long as you got a getCardNumber() in
there.
Wendy Smoak wrote:
From: "Mick Knutson" <[EMAIL PROTECTED]>
> I have a Collection in my ActionFo
Sun's Creator Studio rulez the inexpensive Java IDE world; JetBrain's IDEA
rulez the $300+ IDEs. Eclipse isn't worth a shit.
But REAL programmers prefer ed or vi.
~mark
An old woodcutter once had to chop down a very large tree and all he owned
was a hacksaw. He was really really good at us
Make sure params is of type java.util.Map.
- Original Message -
From: "Laurie Harper" <[EMAIL PROTECTED]>
To:
Sent: Tuesday, June 21, 2005 12:48 PM
Subject: Re: How to pass Jstl param implicit Object to html:link
'params' is a JSTL implicit object; I don't think it's required to be
You can use the fmt library. It adjusts to your locale.
Zarar
On Tue, 21 Jun 2005, Arno Schatz wrote:
> Hi,
>
> How do I present a Date in the users locale in a JSP?
>
> I tried
>
> but the format is not ok. When I use the format attribute it won't show up in
> the locale
> prefer
Short answer: No. You can't use and submit values entered in
input elements to your action without using Javascript.
As Wendy said, you can use a simple link and do this:
my link
If you're not getting user input and simply passing data through using
then you can do something like this:
t of work. SimpleDispatchAction indeed looks much simpler:
http://wiki.apache.org/struts/StrutsCatalogDispatchActionImproved
On 6/17/05, Zarar Siddiqi <[EMAIL PROTECTED]> wrote:
Link looks like:
hi
Make sure you have following in ApplicationResources.properties:
whatever.dispatch=Do Somethin
Link looks like:
hi
Make sure you have following in ApplicationResources.properties:
whatever.dispatch=Do Something
When you load the method Map, make sure something like this happens:
public Map getKeyMethodMap() {
// stuff
map.put("whatever.dispatch", "Do Something");
Shot in the dark, try this:
- Original Message -
From: "Rafael Taboada" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List"
Sent: Thursday, June 16, 2005 10:18 AM
Subject: Re: Pass parameter to javascript function
Finally I found a desesperated solution :'(
But what happend with
Using my action link is probably
better. This way you wont' have to worry about the context path of your
application. might not work since the action is
preceded by the context path. You would have to do something like:
to achieve this.
Using takes care of that.
Zarar Si
Where do you see the af.setURL(String) method in the ActionForward class?
http://struts.apache.org/api/org/apache/struts/action/ActionForward.html
I had a similar problem where dynamic values needed to be passed in via an
ActionForward but I wasn't able to find something as simple as you suggest
56 matches
Mail list logo