I had the same problem some time ago. At the end I decided to go with struts2
instead of JSF for several reasons:
- development time (i am familar with action based frameworks - it reflects
better how i think of web application)
- there is no good JSF framework out there in my eyes. nothing
Hello,
it sure is a matter of taste - but I think its not good to use exceptions for
this kind of things. After all User not found is not an _exception_. Its a
well defined case and it happens frequently. (Except you rely on that the
user exists, eg. in step 2 of a registration process)
I
Hello List,
i try figuring out how security will work with struts2. I have an EJB3
application - the frontend will be written using s2.
I added the RolesInterceptor to an action:
- code
interceptor-ref name=roles
param name=allowedRolesportalUser/param
Am Donnerstag, 8. Februar 2007 schrieb Ian Roughley:
You probably don't need to send it to an action, you just need to render
the HTML form for authentication. So, login.jsp would suffice. As far
as s2 is concerned, authentication is completely external. The role
interceptor just uses the
--- code ---
lia href=s:url action=Register/Register/a/li
--- code ---
This is form the doc of the s:url tag. With jspx this does not work (malformed
xml). How do I use it?
I need it for the css in the header, so s:a does not help me.
upgraded to 2.0.6 - now the error below is thrown when accessing an Action
with validators.
dont know if it is important, but ajax-validation is enabled and the
annotation looks like this:
--- code ---
@RequiredStringValidator(message = Login is required, key
= error.loginname.missing)
Am Dienstag, 27. Februar 2007 schrieb cilquirm:
I see errors like that on occasion ( mine is with the JSONResult type and
the location property ), but they've always been warnings.
Is yours logged at the ERROR level?
they are logged at WARNING level. Should I just ignore them? I do not feel
I do.
It looks vicious, but is pretty harmless.
You could wipe it out of your logs by setting the class that throws it to
only log ERROR and greater.
I will do it for development - but I hope this gets fixed. Exceptions are the
slowest parts in the jvm as far as I know. Performance cant be
Am Mittwoch, 28. Februar 2007 schrieb Ted Husted:
Is DevMode set to false?
no, its set to true.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
opened a ticket today to default our example applications to
DevMode=false so as to alleviate some of the confusion.
-Ted.
On 2/28/07, Piero Sartini [EMAIL PROTECTED] wrote:
Am Mittwoch, 28. Februar 2007 schrieb Ted Husted:
Is DevMode set to false?
no, its set to true
I am using the ajax theme mainly because of the validator and some features
like tabbed pane etc.
But if I submit a form, I want to submit that form and go to the result of the
action - not load it into a div. the result gets decorated again, and I do
not want to force the users into
But my form tag contains theme=ajax because of the validation. is it right
to make the submit button theme=css_xhtml to avoid the ajax-submit?
Am Donnerstag, 8. März 2007 schrieb Musachy Barroso:
Just use the regular submit tag. (no theme=ajax).
musachy
On 3/8/07, Piero Sartini [EMAIL
Am Donnerstag, 8. März 2007 schrieb Piero Sartini:
But my form tag contains theme=ajax because of the validation. is it
right to make the submit button theme=css_xhtml to avoid the ajax-submit?
it needs to be xhtml theme on the submit button.
not very elegant in my oppinion - but it works
Hello.
A couple of newbie questions. Firstly, does Struts2 automatically
create an HTTP Session or do I need to explicitly create it.
Sessions are managed by the servlet-container. Struts does not need to create
them.
Early
experimentation suggests that it's automatically created as I'm
Secondly I need to know when a session is
ended. Is there an established Struts 2 practice for this or do I
still create an HTTPSessionListener object and register it in web.xml
as I would with a basic web-app.
HTTPSessionListener?
You can use
--- code ---
session-config
Hello,
I get the following error when trying to create a list with ognl:
org.apache.jasper.JasperException: /jspx/users/completeProfile.jspx(27,48)
#{'F':'Female','M':'Male'}
contains invalid expression(s): javax.el.ELException: Error Parsing:
#{'F':'Female','M':'Male'}
the code in jspx:
-pattern
el-ignoredtrue/el-ignored
/jsp-property-group
/jsp-config
Will this issue get resolved in the future?
Am Dienstag, 13. März 2007 schrieb Piero Sartini:
Hello,
I get the following error when trying to create a list with ognl:
org.apache.jasper.JasperException: /jspx/users
Will this issue get resolved in the future?
That may have to do with the JSF EL, which also uses #
as its escape char.
If that's the case, probably not?
That is the case. But why not? Its not JSF EL but JSP EL.
I don't think its good to be incompatible with JSP..
I do have the same Problem. But my map does not come from app-context.
The error is the same:
tag 'select', field 'list', name 'country': The requested list
key 'countryMap' could not be resolved as a
collection/array/map/enumeration/iterator type. Example: people or people.
{name} - [unknown
Am Donnerstag, 15. März 2007 schrieb Dave Newton:
--- Piero Sartini wrote:
return Constants.getCountryMap();
What does Constants.getCountryMap() return?
the map looks like:
{de=de, it=it, en=en}
-
To unsubscribe, e
;
}
--- code ---
Am Donnerstag, 15. März 2007 schrieb Dave Newton:
--- Piero Sartini [EMAIL PROTECTED] wrote:
Am Donnerstag, 15. März 2007 schrieb Dave Newton:
--- Piero Sartini wrote:
return Constants.getCountryMap();
What does Constants.getCountryMap() return
Am Donnerstag, 15. März 2007 schrieb Dave Newton:
--- Piero Sartini [EMAIL PROTECTED] wrote:
--- code ---
Are you sure you are using the right Action to reach
the JSP? I cannot duplicate the problem with identical
code. (I am not using JSPX, although I'm not sure that
would matter.)
Uh
Just wondering how you guys would make something like this:
When a Field in a form is null or empty it should be displayed, if it is
already filled it should disappear.
Is there an easy way to do this with s2? Use-Case is to ask the user missing
information after login.
Piero.
I tried to apply the patch that is in JIRA - but it does not work. I guess it
is not only the change in the JavaScript but somewhere in the Java classes as
well.
Is there a prepackaged 2.0.7 somewhere? Or do I have to build it by myself?
Need to present s2 soon and it would be great if I get
Am Dienstag, 20. März 2007 schrieb Musachy Barroso:
I think the daily builds are for 2.1 only. If you want to build it:
http://struts.apache.org/2.x/docs/building-with-maven.html
I tried to build tags/STRUTS_2_0_7 as well as trunk. both seem to be broken:
[surefire] Running
=user.email==null
s:textfield key=user.email name=user.email /
/s:if
On 3/20/07, Piero Sartini [EMAIL PROTECTED] wrote:
Just wondering how you guys would make something like this:
When a Field in a form is null or empty it should be displayed
Thank you Ted,
like Harring I also wondered what namespaces are all about and decided they
arent that important to me - however, already tried to make action names
like foo/bar. Now I consider namespaces very useful.
Maybe this should be included in the wiki somewhere. (Tips Tricks Corner?)
However, I am completely lost with Struts 2. Everything servlet
dependent is abstracted away somewhere. I've been looking at the
tutorials and they don't cover this kind of thing at all.
How do I go about putting the equivalent in an action with Struts 2?
An action class can implement
I will create a FAQ entry.
good idea.
maybe it makes sense to merge it with this one:
http://struts.apache.org/2.0.6/docs/how-can-we-access-the-httpservletrequest.html
Piero
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
I'm looking at the javadoc for this, it doesn't say much. Do I just
create a class scope variable for the session context and then set
that from the argument in the set method?
That is exactly how it works. You might want to look at ServletSessionAware,
ServletRequestAware,
Am Freitag, 23. März 2007 schrieb Dave Newton:
--- Daniel Felix [EMAIL PROTECTED] wrote:
[ the two JAR files ]
I still think it's the double-JAR problem.
yes, looks like that. the error message says it all.
struts2-spring-plugin is loaded in 2 places:
acnsf/struts2-spring-plugin-2.0.6.jar
I see this warning as well when using ajax-validation. It seems ognl expects
a .methodName method which is not there in the struts validators.
There is another thread regarding this problem with the Topic Problem with
2.0.6. The warning is there in 2.0.7 as well.
Ted suggested to turn off
On Saturday 07 April 2007 22:15:18 [EMAIL PROTECTED] wrote:
Now since it looks like I am running into compatibility issues, is there
any alternative for this tag lib ?
I need some thing very similar that provides paging and to be as easy an
.net control components.
Does struts provides a
Apr 7, 2007 1:47:30 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Apr 7, 2007 1:47:30 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/person] startup failed due to previous errors
looks like there is a problem with a listener
I want each widget to be programmed with struts, meaning that:
Each widget must have it's own control configuration (struts.xml) and
it's own set of classes.
If you are using struts2, you could develop your widgets within their own
packages and namespaces within your main application.
See
On Sunday 08 April 2007 01:13:33 Asaf Paris Mandoki wrote:
How can I call an action of a widget form an action of the application
and have the result returned as a string?
Look at the action tag [1]. You can execute an action and store its result
within a request property.
Piero
[1]
On Sunday 08 April 2007 02:01:24 Asaf Paris Mandoki wrote:
I forgot to say that the directory structure i wrote on my first post
(which was wrong [forgot the web-inf directory]), should be inside a
directory of the application. So each widget should have it's own
classes directory, struts.xml,
On Monday 09 April 2007 03:30:27 Jae K wrote:
Can users get access to edit the wiki? It's driving me crazy.
You have to sign a CLA first. More information:
http://struts.apache.org/helping.html#documentation
Piero
-
To
I coded this today, just used the field instead of a setter method. Your
pseudo code was very helpful, thanks :-)
Maybe the following snippet is useful for someone with the same problem.
Should I post this on the wiki as well? I am not sure if it is a good
solution - but it works for me.
Can
for new projects where you have the choice what to use, I suggest struts2.
On Tuesday 10 April 2007 20:30:21 dire wrote:
sorry for my English!
in my term paper i want to use Struts. Before this time i don`t have a deal
with it. in http://struts.apache.org/ i saw that struts had two versions.
I did look at JSF/Seam/Shale and other web frameworks before I decided to use
Struts2.
There were several reasons for my decision and I have not regret it since now.
After many years of web development an action based framework like s2 for me
is much more natural than a component based
There is the cssClass parameter for (all?) struts2 tags.
s:a href=resultPageUrl cssClass=taboffview search results/s:a
More information:
http://struts.apache.org/2.x/docs/a.html
Piero
On Wednesday 11 April 2007 01:10:43 Minerva CC wrote:
Hi,
I tried to define a display style class in s:a tag
On Wednesday 11 April 2007 01:49:01 Asaf Paris Mandoki wrote:
Wouldn't a forum be more appropriate for this kind of exchange?
I am not sure. Personally I do prefer mailing lists. They save a lot of time,
especially if you are subscribed to a lot of lists. Navigating to different
forums is not
On Wednesday 11 April 2007 15:19:27 Frank Russo wrote:
Actually, I disagree. JSF is a framework. I used MyFaces and their
component library exclusively, without using Shale, Seam or anything
else...
I used JSP and Servlets exclusively to build web apps years ago. JSP is no
framework for most
If I do understand it right then your s2 app works when deploying the war
manually to tomcat. But if you try to start within eclipse it does not work?
There _must_ be some configuration issue with WTP. I guess there are some
libraries from s2 that are packaged in the war but are not included if
Hello list,
the last days I've read a lot about web frameworks in java. And the more I
read, the more questions I have. Just writing this down, maybe someone has
some thoughts that can help me.
My problem is simple, or lets say it should be simple: What webframework is a
good choice to start
JSF is considered a MVC framework, just as ASP.NET is a MVC framework.
These frameworks are component-centric. You build pages by assembling
components, and the components can each fire their own actions to
obtain and maintain state. Frameworks like Struts and Spring MVC are
action-centric.
As Don mentions, you can use JSF components with Struts2 pretty easily, and
that can be a good avenue if you primarily want JSF for the visual
components part, and don't need/want the managed beans and lifecycle
controller parts. If a framework on top of JSF is what you are after
(which is a
I have some code I need to initialize when the servlet comes up for the
first time. How do I do that when I'm using struts and I do not have my
own servlet? Do I create a servlet just for this purpose?
If you need something that is initialized when your webapp starts, I would
suggest to
Am Montag, 22. Oktober 2007 19:27:59 schrieb enthucoder:
I have requirement where, i need to send session id of app2 to a listener
page in app1 (i.e non jee based one and i am allowed to send this
information as a 'get'), everytime the a new page loads or user goes to new
page in app2, without
Am Montag, 22. Oktober 2007 13:23:38 schrieb zul;jami:
Still I am getting the error,
my execute also fires update on load.
There is no img tag with empty src attribute
execute() is triggered when the action is called, not only when you submit
your data.
Piero
its a very nice example which u have sent but i have a doubt that
as u are using salt(generation) adding to the encripting code that will be
fine for registeration but what ab the login time how you are going to
decript the data base code?
You do not need to decrypt - you just
If you've used Maven before you're probably better off checking out the
source and performing your own build. It would take less than 10-30
mins to setup.
http://struts.apache.org/2.x/docs/building-the-framework-from-source.html
If maven is used, 2.1.1-SNAPSHOT should work:
pluginRepository
idapache.snapshots/id
nameApache Maven Repository (Snapshots and Test
Builds)/name !--
urlhttp://people.apache.org/repo/m2-snapshot-repository//url --
urlhttp://people.apache.org/repo/m2-snapshot-repository//url
Am Montag, 14. Januar 2008 17:37:19 schrieb Frans Thamura:
hi there
i just testing struts2 2.1.0,
can help me how to test the REST plugins,
am i have to get from SVN or can use this?
i know that 2.1.0 is the pre relase for 2.1.1
If you are using maven, just include the following
Am Montag, 14. Januar 2008 17:41:06 schrieb Frans Thamura:
hi there
where is the place so i can download the codebehind plugins?
If you just start, I would suggest trying the new convention plugin. You can
find it here:
However, i
did not see
the source for any of the com.opensymphony.xwork2.* classes. Is the
source
for these classes available?
XWork is a seperate project at opensymphony. You can get the sources from
https://svn.opensymphony.com/svn/xwork/
Piero
I need to map all incomming urls to one and the same action.
This action works like a dispatcher - acctording to some data taken from
the data base, decides where to redirect the request.
I''ll appreciate any ideas!
I think an Interceptor would be a better solution for this:
Am Donnerstag, 21. Februar 2008 20:21:33 schrieb Maria Lujan Salvadori:
Hello, is it available the new version 2.1? Where can I download it? We
want to migrate our project from 2.0.11 to 2.1 but we cannot find it
Be aware that there are a lot of incompatible changes between 2.0 and 2.1, so
Hello,
I am trying to write an authentication plugin for struts2. Goal is to reuse it
across several projects so a plugin seems the way to go..
There is an Interceptor defined in struts-plugin.xml, lets call it
AuthenticationInterceptor. Problem is that I am not able to use it in my main
Am Mittwoch, 27. Februar 2008 01:59:36 schrieb Jeromy Evans:
You're following the right approach.
..
In any case, the approach works so you probably just have a minor config
error. Post your config (struts-plugin.xml and struts.xml) if the
statement above doesn't help.
Thank you, that
If you don't intend to have your application's package extend the
package defined in your plugin (which doesn't scale to multiple
plugins), what's the benefit of having this be a plugin as opposed to
just a .jar file?
I hoped that the plugin architecture will help me with the configuration
Am Donnerstag, 13. März 2008 22:32:34 schrieb Frank Fischer:
Now i don't understand (1) where to create/initialize these business logic
classes and (2) how to get access to them from the action classes.
Just build your business logic without thinking about s2 too much. From your
action classes
Am Mittwoch, 26. März 2008 14:35:26 schrieb Daniel:
Hello,
What is the best solution to integrate struts 2 and ajax? What libraries?
DOJO is shipped with Struts2 - but my impression is that most people do use
other frameworks like jQuery or prototype, writing their AJAX code by hand.
I will
yes, I did go to the site. but, i'm not sure on how to make it as a
plugin to deploy in eclipse 3.3.
There is no plugin for Eclipse or any other IDE that I know. There is the
beginning of a NetBeans plugin... but I did not look at it yet.
i did downloaded the war file and import into eclipse
I want to use s2.1 for a new project. Now I try to figure out how it is
possible to make a realtime validator that is fired when the user switches
fields.
With 2.0.8 there was DWR and the ajax theme. Now I do have the dojo plugin and
the interceptor. sx:submit tag .. but there are no sx:form
I have the following situation:
a searchfield is on top of a table presenting results. if there is only one
result, the user should be redirected without the need of clicking on the
list..
now my problem is how to redirect to an action and passing a parameter from
within my original action..
- For a new project, which I would like to eventually move it to JSF?
choose the technology (component based or action based) before choosing the
framework.
if you want to go for a component based approach like JSF then choose a
framework like Apache Shale or JBoss Seam. Even VWP may be
On Thursday 23 August 2007 23:43:40 Pavel Sapozhnikov wrote:
Hi everybody. I remember in Struts1 we have those things ActionForms and
when you submit a form everything gets copied to into a form in fact you
can make your own form in Struts1. Is the same possible in Struts2 for
instance I heard
On Friday 24 August 2007 12:29:23 Laszlo Borsos wrote:
If some properties are in the action bean (e.g. hidden fields) and
others in the model bean, will both be populated, because both object
are found on the stack? If so, is the model object the upmost stack
element?
I am not sure if both
We do use TopLink Essentials. Beside the somewhat confusing error messages
already mentioned by musachy we are very happy with this choice.
JPA is just great :-)
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Am Dienstag, 18. September 2007 20:22:41 schrieb Sairam01:
I'm unable to include a jsp dynamically. The include tag doesn't evaluate
VALUE of the expression.
s:include value=%{someName}.jsp/
someName is a attribute on my action code. Should this work..?
s:include value=%{someName}.jsp/
is
Starting server Bundled Tomcat (5.5.17)
Starting of Tomcat failed, the server port 8084 is already in use.
...
please give me suggestions,how i can run my program.
If there are errors when running tomcat (eg. not enough PermGen space / Out of
Memory) netbeans 5.5.x cannot control it anymore.
Should smarturls 2.0.18 work with struts 2.1?
I get the following error:
Caused by: Unable to load bean:
type:org.texturemedia.smarturls.ResultMapBuilder
class:org.texturemedia.smarturls.DefaultResultMapBuilder - bean -
I am searching a table comparison like this for all features and
enhancements from 1.x to 2.x:
There is nothing like that because Struts 2 is not based on Struts 1 but on
WebWork - it has a complete different code base.
Maybe this comparison does help:
Since my Model is acquired from the Hibernate session (during the
prepare() Action method), it is a transactional persistent instance.
Note this from the hibernate documentation:
Transactional persistent instances (ie. objects loaded, saved, created or
queried by the Session) may be
Am Montag 01 Oktober 2007 23:33:01 schrieb Emi Lu:
Is there a way to hide .action .do by using filter url-pattern?
Have a look at
http://code.google.com/p/smarturls-s2/wiki/WalkThrough (last paragraph:
Extensionless URLs)
-
Am Montag, 21. April 2008 23:59:46 schrieb Chase:
Given that the doc in question was last edited July 2007 to include 2.1
information has 2.1 been released already and I'm just not looking in
the right place?
Struts 2.1 has no GA release yet. That said, I think it is very stable and
possibly
Hello,
Do we have some similar mechanism is JSP 2 + struts2?
Or Do i must use struts2++ library?
JSP can not do that out of the box. But there are very good solutions
available. Have a look at Sitemesh or Tiles2:
- http://struts.apache.org/2.x/docs/sitemesh-plugin.html
-
The S2 version is 2.1.3-SNAPSHOT. The exact same project was working some time
ago with 2.1.1-SNAPSHOT. So maybe this is something that got broken in newer
builds.
The problem seems to be that Freemarker can't get its configuration at this
point. But ActionContextCleanUp is the first filter in
Maybe the header of your struts.xml does use the wrong DTD.
The correct header looks like this:
?xml version=1.0 encoding=UTF-8?
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd;
Am Montag, 14. Juli 2008
Hello,
you can try the following settings in struts.xml:
constant name=struts.i18n.encoding value=UTF-8/
constant name=struts.locale value=de_DE/
Please let me know if this resolves your issue.
Piero
Am Montag, 14. Juli 2008 15:25:14 schrieb Marc Eckart:
Hi,
we have an
the wiki of the sitemesh
plugin ..
Am Montag, 14. Juli 2008 15:23:16 schrieb Piero Sartini:
The S2 version is 2.1.3-SNAPSHOT. The exact same project was working some
time ago with 2.1.1-SNAPSHOT. So maybe this is something that got broken in
newer builds.
The problem seems
everything gets documented.
musachy
On Mon, Jul 14, 2008 at 1:22 PM, Piero Sartini [EMAIL PROTECTED]
wrote:
Ok, the problem was that since 2.1.3 the filters changed:
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
instead of ActionContextCleanup and
org.apache.struts2
Am Freitag, 20. Juni 2008 13:43:00 schrieb Ted Husted:
But why does web application still seem so difficult or so
time-consuming? Are there time bandits that still suck days or weeks
out of your development schedule? Are there time gremlins that
nickel-and-dime you every hour of every day? Is
|-/libs/struts.jar
|-WAR
|
|-/index.jsp
|
|-EJB.jar
/libs/ is for general libraries used by your application (logging comes to
mind, StringUtils or just about anything that is used among your modules).
The struts.jar has to go into the WAR. Under
You can use the simple theme. Or customize the templates of the xhtml theme.
If you use the css theme then you may style it via css as well.
I am using the simple theme - it gives the most control. IMHO the other themes
are not flexible enough and make more work than they save.
Piero
Struts2 does create a new Action for every request.
Do you use Spring? I think you can configure it to reuse the beans...
Piero
Am Samstag, 26. Juli 2008 19:48:47 schrieb Arun M:
We are using struts 2.0.11
We have lots of action class. Say one of them is CustomerRegisterAction
(which
Am Sonntag, 27. Juli 2008 06:04:46 schrieb Arun M:
Yes , we are using spring and hibernate also along with struts.
Could you suggest us, where to configure to resue the beans ??
The spring plugin is described in detail at
http://struts.apache.org/2.x/docs/spring-plugin.html
I am not using
Am Sonntag, 27. Juli 2008 21:44:04 schrieb Chris Pratt:
You might want to look into the RESTful URL's plugin. But you can
just override the extension. I usually set mine to .html (to hide the
technology being used), but I believe you can set it no nothing as
well. I use the following in
No one have any idea how to access session variable in jsp in this kind of
simple scenario ?
You may access your session variable just like you would do without S2. There
is no difference. Then use either the s:test tag from struts or c:if from the
standard tag library.
Piero
It's seems like that redirect action doesn't
pass
or set session to another action class.
If you can't give us the code, we aren't able to help you.
Session's don't need to be passed between actions. They are managed by the
servlet container. But it is pretty safe to assume that Struts2 is
Is Struts 2.1.x still bound to DOJO?
It isn't - DOJO is available as a plugin since 2.1.x
But there is no possibility to use the AJAX theme without DOJO right now.
There was an interesting discussion at struts-devel:
-
He mentioned html:submit - I guess we are talking about Struts 1, so there are
no themes involved.
Piero
On Monday 22 September 2008 22:14:50 Kawczynski, David wrote:
FYI, a theme can be specified in a s:form tag or any of its s: form
elements via theme=simple|xhtml|ajax attribute.
On Monday 09 February 2009 16:43:09 xianwinwin wrote:
Hi all,
here's a scenario:I have some methods that before executed, they should run
an interceptor --to verify if the user is authorized to do something.
Write your own interceptor and check for your annotation. Something like this
should
95 matches
Mail list logo