Why not redirect to the struts 2 action you want?
This is the jsp I use for error pages in tomcat:
<%response.sendRedirect("error.do");%>
where error.do points to a struts 2 action
Josh
On Nov 7, 2007 5:15 PM, matihost <[EMAIL PROTECTED]> wrote:
> > This error page is defined in my web.xml:
>
You can do this with Struts 2, but I've found that it can be a bit
hairy when it comes to type conversion. The general idea is to use an
action property which is a Map of objects that you want to save keyed
by a unique identifier for each one. The two problems that I run into
when doing this are:
Looking through some code here, this is what I have:
The above seems to work OK, though I'm a little curious about the
inclusion of the double parentheses at the end of "entrySet" -- OGNL,
as far as I am concerned, is a bit of strange beast.
Josh
On 9/12/07, Cory D. Wiles <[EMAIL PROTEC
Oops, I missed that you are using Struts 1. I believe that you can
use the format attribute of the bean:write tag:
http://struts.apache.org/1.1/userGuide/struts-bean.html#write to
specify a format string as described on:
http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html
Josh
http://cwiki.apache.org/confluence/display/WW/text will do what you
need. Take look at the example with resource property "format.money"
and note the link to
http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html
which has the info you need to build a format pattern. You could also
${} is for writing JSP EL, while %{} is for writing OGNL. Both serve
similar purposes, and if you have a servlet container that supports
JSP EL and are running Struts 2, they can be used almost
interchangeably. For more details you can read up on the JSP EL:
http://java.sun.com/j2ee/1.4/docs/tuto
If you return null from your Action you can write directly to the response:
HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("image/jpg");
out = response.getOutputStream();
write image here
return null;
On 7/18/07, Roberto Nunnari <[EMAIL PROTECTED]> wro
On 7/12/07, Niall Pemberton <[EMAIL PROTECTED]> wrote:
I don't use Struts2 - but my guess is that this is down to a single
quote being an escape character in MessageFormat:
http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html
So its probably not a bug - just need to escape singl
Actually, I think this is a bug in the handling of MessageResources in
Struts 2. Not only do ' characters in properties files fail to
display, they cause parameter substitution to fail. For example, if
you have a properties file:
foo=Message's for {0}
and you attempt to display it in a jsp lik
I would argue against making interfaces for all your DAOs unless you
know up front that you will be creating multiple implementations. So
long as you don't make any of the methods on your DAOs static, it is
an easy matter to extract interfaces from them at a later point, when
and if you need to d
Or, you can use the s:text tag (assuming you are using struts 2) and:
where format.decimal is defined in a resource bundle somewhere (see
http://cwiki.apache.org/confluence/display/WW/Localization for
details) as:
format.decimal={0,number,###.##}
The text tag reference
(http://cwiki.apache
Where do your domain classes fit into your structure? I suggest
thinking about whether you need those "helper" classes (I'm assuming
this is something like a Service Layer) or whether the logic that you
are planning on putting in the "helper" classes would be better placed
in your domain classes.
Well, I couldn't figure out why the include tags don't work, but I did find:
which seems to do the trick.
Josh
On 5/25/07, Josh Vickery <[EMAIL PROTECTED]> wrote:
I'm running into some strange behavior when using s:include and
jsp:include with Struts actions as the incl
I'm running into some strange behavior when using s:include and
jsp:include with Struts actions as the include target.
If I put or I get a completely blank page with no error
messages.
It works fine if I include a jsp (/pages/somePage.jsp).
I haven't spent much time trying to track down the s
Not the most elegant solution, but you can pull the ApplicationContext
from the ServletContext:
ServletContext sc = ServletActionContext.getServletContext();
(ApplicationContext)sc.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
Josh
On 5/23/07, Célio Cidral Junior <
I agree! I would use checkboxes instead of a checkboxlist rather than
write my own theme. I did something like that recently:
On 5/17/07, Allen Gilliland <[EMAIL PROTECTED]> wrote:
yeah, this is for struts2. that's a shame, hacking my own theme just so
that my list gets
If you like RoR (and I do) you might like some of the "magic" that
Struts 2 and Spring can provide. It isn't quite perfect yet (at least
not the Struts 2 part), but I'm pretty happy with it. By "magic" I
mean convention based configuration, which cuts down on the number of
places you have to ent
Spring has several components, but the one I use (and the one I think
is the most popular) is the Inversion of Control (IOC) framework.
Struts 2 (when it was Web Work) had some IOC support, but it wasn't as
full featured as what Spring offers.
Spring also has an MVC, which is a direct competitor
my Actions.
On 5/4/07, Flemming Seerup <[EMAIL PROTECTED]> wrote:
Thanks, that what was I was looking for. I will take a look at your
example,
but I'm also considering just writing my own RolesInterceptor ...
F
Quoting Josh Vickery <[EMAIL PROTECTED]>:
> Flemming, if y
Flemming, if you are not using JAAS, and don't want to interact with
it, you can fake it by wrapping the HttpServletRequest in a servlet
filter. This is the method used by SecurityFilter
(http://securityfilter.sourceforge.net/) and is very easy to
implement.
Here are some code snippets:
A filter
The easiest way I've found to do this is to write a ServletFilter that
wraps the HttpServletRequest with a class that implements the
isUserInRole method based on your database roles from an object you
populated and placed in the Session.
Josh
On 5/1/07, Flemming Seerup <[EMAIL PROTECTED]> wrote:
21 matches
Mail list logo