ok, but I read somewhere that I can do that without setting a property User
in my action, using the action stack, or something like this, I believed
that last action I have used should be available, or not?
Hernandez, David wrote:
Set the Bean as a member of the Action class and use:
deko babu,
Cognizant people are supposed to be the experts
therefore they should not ask for help like this.
Unfortunately, I am also looking for the same answer
--- [EMAIL PROTECTED] wrote:
HI
I am not able to find out pagination using Struts2.
Is there any tag lib ( which is similar to
Hello DharmaRao,
take a look at the s:iterator and s:subset Tag.
They allow you to iterate over a list for example and also take subsets
out of it.
http://struts.apache.org/2.0.11/docs/tag-reference.html
- Thilo
[EMAIL PROTECTED] wrote:
HI
I am not able to find out pagination using
Access the ValueStack in your action, it allows you to store objects and
you can retrieve them from your jsp. You might need to know about the
ActionContext object accessable from your action.
Read more from the docs :)
- Thilo
vijay vijay wrote:
Hi
i am writting a database
I need to know how can I set autoreload of struts.xml in struts2, without
restarting the container every time.
--
View this message in context:
http://www.nabble.com/how-can-I-set-autoreload-of-struts.xml-in-struts2-tf4820634.html#a13791425
Sent from the Struts - User mailing list archive at
2007/11/16, vijay vijay [EMAIL PROTECTED]:
do i nedd to add any jar for this ServletActionContext. any suggeestions
Struts 2 core for example...
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
Over on dev@, a couple of us are working on a JPA MailReader. Rather
than just try and port the old version, we're also refactoring the
internal design so that it's more in line with the JPA overall.
I know the JPA is growing in popularlity among Struts developers. I
was wondering if there are
I forgot to ask are you using Struts 1 or 2?
In any case you should define your action mappings in the struts.xml.
There you will define the different jsp results for your action. I don't
think you need the requestdispatcher for that?
- Thilo
vijay vijay wrote:
Hi i am having small
sure, in your action method you can define:
ValueStack stack = ActionContext.getContext().getValueStack();
and then fill whatever object you have into the valuestack:
String sample = Hello World;
stack.set(myIdentifier, sample);
In your JSP you can use the s:property tag to display your
Hi i am having small requirement like i have to connect to db from db i have
select ted the emp table from there i need to show that result in my
jsp.ihave written java code like this below in action .here i am not
able to knw
how to proceed from here
can u help me here
*
public* *class*
You can expose a property or bean to the JSP Expression language
(${myPropertyOrBean}) by using s:set taglib.
- Thilo
slideharmony wrote:
ok, but I read somewhere that I can do that without setting a property User
in my action, using the action stack, or something like this, I believed
that
Hi,
I am using the struts if tag and want to use a constant from another
class inside the if test condition.
How can I do it?
The relevant code snippet is:
%@ taglib prefix=s uri=/struts-tags %
[EMAIL PROTECTED] import=com.example.Account%
s:if test=status ==
I think you have to tell your container to watch certain resources.
(WatchedResource in Tomcat;
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html for example)
- Thilo
slideharmony wrote:
I need to know how can I set autoreload of struts.xml in struts2, without
restarting the
Hi can u give me some sample code to me
On 11/16/07, Thilo Ettelt [EMAIL PROTECTED] wrote:
Access the ValueStack in your action, it allows you to store objects and
you can retrieve them from your jsp. You might need to know about the
ActionContext object accessable from your action.
Read
I think in the URL
http://struts.apache.org/2.x/docs/ajax-tags.html
say how work in 2.1
but I suppose Ajax should work since 2.0
Stefano
- Original Message -
From: Dave Newton [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, November 16, 2007
this line:
newuser = (User)getSession().save(user);
Hernandez, David wrote:
What line's the Exception being thrown on?
-Original Message-
From: slideharmony [mailto:[EMAIL PROTECTED]
Sent: Friday, November 16, 2007 9:35 AM
To: user@struts.apache.org
Subject:
I have another question:
it is right in struts2 to put beans in session? Assuming to have an action
that retrieve a bean User from the database; the user have a set of
contracts. I want to iterate this set in a jsp page, which ways have I to do
that? I have to put the bean User in session, or is
In your action:
class Whatever extends ActionSupport{
User user;
public User getUser(){return User;}
public String execute(){//set User}
}
In jsp:
s:property value=user.memberVariable /
-Original Message-
From: slideharmony [mailto:[EMAIL PROTECTED]
Sent: Friday,
What's utente?
In any case, you don't say where the exception is, but
for whatever reason your DAO isn't getting a user (if
that's where the exception is).
d.
--- slideharmony [EMAIL PROTECTED] wrote:
Hello,
I have a problem saving a bean User. I use the
following code:
UserDao dao =
What line's the Exception being thrown on?
-Original Message-
From: slideharmony [mailto:[EMAIL PROTECTED]
Sent: Friday, November 16, 2007 9:35 AM
To: user@struts.apache.org
Subject: ClassCastException
Hello,
I have a problem saving a bean User. I use the following code:
UserDao dao
Does it work at all? I thought no ajax tags would work until version 2.1
. . .
-Original Message-
From: Stefano Greco [mailto:[EMAIL PROTECTED]
Sent: Friday, November 16, 2007 9:08 AM
To: user@struts.apache.org
Subject: [S2] autocompler + ajax in 2.0.11
Hi,
I'm using autocompler with
This exception is being thrown:
No result defined for action com.lehman.maps.servlet.AdminAction and
result success
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct
ionInvocation.java:350)
Even though I have this in struts.xml:
action name=admin
Hello,
I have a problem saving a bean User. I use the following code:
UserDao dao = new UserDao();
User user = new User();
Service.populate(user);
dao.save(utente);
if(user != null){
return SUCCESS;
}
here is the dao.save method:
public User save(User user){
Utente newuser = null;
begin();
i am using strut2 only thats why i asked you i am not able proceed further
On 11/16/07, Thilo Ettelt [EMAIL PROTECTED] wrote:
I forgot to ask are you using Struts 1 or 2?
In any case you should define your action mappings in the struts.xml.
There you will define the different jsp results for
Hi,
I'm using autocompler with ajax theme
as in this example:
html
head
...
s:head theme=ajax/
..
/head
body
s:form ...
s:url id=getTeams value=/getTeams.action/
s:autocompleter name=team key=label.team href=%{getTeams}
Why wouldn't you just expose an action property
through normal means?
--- Thilo Ettelt [EMAIL PROTECTED] wrote:
sure, in your action method you can define:
ValueStack stack =
ActionContext.getContext().getValueStack();
and then fill whatever object you have into the
valuestack:
Look into the open source project called displayTag, I think that will
save a lot of headaches and reinventing the wheel.
http://displaytag.sourceforge.net/10/jdepend-report.html
On 11/16/07, Thilo Ettelt [EMAIL PROTECTED] wrote:
Hello DharmaRao,
take a look at the s:iterator and s:subset
Hi all,
The best thing to do to use the isUserInRole method is to define a filter
which propagate your own request wrapper ...
in this wrapper you redefine the isUserInRoleMethod
It's this method which will be used by the struts2 role interceptor.
To define a taglib which can test the role,
I personally tried with struts tags and JSTL tags I decided to give up
after a while (I solved it by creating my own isUserInRole tag.)
This in fact would be a nice addition to the struts 2 tags, it even
can be implemented by delegating to the if tag implementation, so that
you can have automatic
do i nedd to add any jar for this ServletActionContext. any suggeestions
Looks like you are trying for RESTful URLs, check out the REST plugin from
the plugins page. It's part of standard s2 distribution 2.0.11. Also, take a
look at Restful2ActionMapper javadocs.
Amit Rana wrote:
From: Omkar patil
Amit,
I am not sure if there is any easy way to achieve this. Is
Hi
i am writting a database connectionin action, here i wanted to put
tth result back in to a jsp page.
in jsp what i need to write
any one help me here
yes, it was the problem, I have solved it! thanks
Nils-Helge Garli wrote:
Assuming you're using Hibernate or something, the save method probably
returns the generated identity of the stored object instance. So my
guess is that you're getting the id of the user returned, which is a
Long,
s:iterator..., but otherwise correct ;)
--- Hernandez, David [EMAIL PROTECTED]
wrote:
Sorry, if you want to iterate through the contracts,
let's say they're
members of User (name contracts) in jsp:
s:iterate value=user.contracts
s:property value=someMemberOfContracts /
/s:iterate
Just to further Dave is saying.
If the class is a proper JavaBean with a zero-argument constructor, if
it is null during autopopulation, then the framework will
automatically instantiate it.
For fancier implementations, we can even provide a custom type
converter for a class, that could do
Assuming you're using Hibernate or something, the save method probably
returns the generated identity of the stored object instance. So my
guess is that you're getting the id of the user returned, which is a
Long, and not a User object.
Nils-H
On 11/16/07, slideharmony [EMAIL PROTECTED] wrote:
From: Omkar patil
Amit,
I am not sure if there is any easy way to achieve this. Is there any
specific reason you would like achieve this? One way could be provide
your own action mapper class by extending DefaultActionMapper and
overriding getUriFromActionMapping method to provide your own
--- Hernandez, David [EMAIL PROTECTED]
wrote:
Is there an easier way than creating a theme to
format the layout of an xhtml theme form?
I really just want some of the fields to be on the
same line . . .
You can always set the theme on a tag-by-tag basis via
the theme attribute:
s:textfield
Yeah, I wanted to keep the label attribute, I mean it's not a big deal
to add it myself. I was just wondering if there was some shortcut I was
missing. Thanks anyway . . .
-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED]
Sent: Friday, November 16, 2007 1:58 PM
To: Struts
Is there an easier way than creating a theme to format the layout of an
xhtml theme form? I really just want some of the fields to be on the
same line . . .
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
This message is intended only for the personal and
Hi Ted,
I'm developing a framework (which someone else called 'featherweight') to
integrate 'your package of choice' of IoC, JPA, transaction management,
domain-driven tiers and servlet MVC without EJB.
To answer your question, I haven't had to do much to plug in OpenJPA and Struts2
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
Here is how to do it -
http://struts.apache.org/2.0.11/docs/how-can-we-force-the-action-mappings-strutsxml-to-reload.html
slideharmony wrote:
I need to know how can I set autoreload of struts.xml in struts2, without
restarting the container every time.
--
View this message in context:
Adam Gordon wrote:
I think the solution is
going to be to redirect the user to the default main page manually w/
the login parameters and JAAS should take over from there...hopefully.
Except a redirect must be to a GET, not a POST, and it would be
unfortunate to include the login credentials
Laszlo Borsos wrote:
I started using Spring 2 with Struts 2.
I can't use wildcard mappings though.
This works: action name=login class=loginAction
This does not: action name=* class={1}Action
Is there any way around this?
kuvera
-
http://javatar.hu Java EE programming
Laszlo,
It
Let me get this straight: All pages in your webapp are protected (not
available to non-logged in users), so when someone who is logged in on
the company's main site tries to get to a page in your webapp, JAAS
catches it and sends them to your webapp's login page, which might be
able to glean
Hello Everybody!
I need to check roles of a user in my app to decide whether to render
some elements on JSP or not. Does someone happen to know how could I do
it (I mean the syntax of s:if tag together with
request.isUserInRole(role) on the JSP page)?
Thanks a lot.
Patches are always welcome (once you get it figured out) :)
On Nov 15, 2007 2:22 PM, Hernandez, David [EMAIL PROTECTED] wrote:
Thanks guys. The bootstrap should have an example where the fields are
populated by the Action Class's member variables. But I figured it out,
I think . . .
You can call specific methods on actions in several
different ways, the s:submit method=foo.../, for
example, will submit a form to be processed by a
specific method. You *could* use the same technique to
pass a parameter in a GET URL; see the associated
discussion regarding this from just a few
Is there something like the struts' dispatchaction in struts2? or have I to
use different actions?
--
View this message in context:
http://www.nabble.com/dispatchaction-in-struts2-tf4822558.html#a13796997
Sent from the Struts - User mailing list archive at Nabble.com.
Sorry, if you want to iterate through the contracts, let's say they're
members of User (name contracts) in jsp:
s:iterate value=user.contracts
s:property value=someMemberOfContracts /
/s:iterate
-Original Message-
From: slideharmony [mailto:[EMAIL PROTECTED]
Sent: Friday,
Hi All, I need some clarification ( rather suggestions ) on the below.
action-mappings
action
attribute=firstActionForm
input=first.jsp
name=firstActionForm
path=/firstAction
scope=request
type=com.deo.struts.action.FirstAction
forward name=success
I would look into the following Patterns:
BusinessDelegate , SessionFacade
For Database connectivity with EJBs you should also look at
servicelocator.
Typically what I do is:
Have an action:
To retrieve data from a database -- I pass all necessary
interface parameters to a
Wow, that was a lot of code.
The expurgated version is that in Struts 1 there are
two basic ways to do it: put the bean into a scope,
generally request or session, or set properties on
your ActionForm (which itself is either request- or
session-scoped).
d.
--- [EMAIL PROTECTED] wrote:
I would
Hi folks,
I know it is a stupid question. But how shall I pass JavaBeans from an
Action object to a JSP page? Use setAttribute('xxx',xxx)?
I have a list of JavaBeans that I want to pass to JSP pages to display
one by one.
Shall be a very simple question to anyone who is not a brand new
beginner
Yes,
That is generally what I'm saying...
For maintainable code, look at the patterns I went into.
If you are writing a very large application, they will make
your application easier to debug and maintain in the future.
-Original Message-
From: Dave Newton [mailto:[EMAIL PROTECTED]
Yea, but in this case, it may be something we need to live with.
The login page scriptlet code looks for the login credentials in the
request and sets the appropriate form fields as well as a flag we use to
indicate whether the form should be submitted immediately upon loading
and in either
--- [EMAIL PROTECTED] wrote:
For maintainable code, look at the patterns I went
into. If you are writing a very large application,
they
will make your application easier to debug and
maintain
in the future.
It's not so much that I'm unfamiliar with writing
large applications but that the
After ApacheCon (slides from my REST talk available [1] ), I had on my
mind a few projects that I'm thinking about working in no particular
order. Anyone interested in REST and/or Struts 2 Plugins, give it a
look and please chime in with your ideas.
John,
You have two ways to do this:
1) Use RequestUtils.createActionForm to create the 2nd form and stick
it in session scope.
2) Redirect to the second action, and include the properties you want
to populate as request parameters.
Paul
On Nov 16, 2007 3:20 PM, John C Alex [EMAIL PROTECTED]
Struts 2 can use a filter, but Struts 1 is servlet based.
On Nov 14, 2007 5:48 PM, Laurie Harper [EMAIL PROTECTED] wrote:
Friend Here wrote:
without ActionServlet can i use struts ?
could u plz explain abt this ...
How would you envision using Struts without ActionServlet, which is the
If the forms were named the same thing then would the
same instance be retrieved in the second action?
I vaguely recall I trouble-shot an application
unknowingly had two actions with the same name
attribute, and since they were dynaforms there was no
class-cast exception to help clue them in.
I'm having a problem with iterators and getting value updates. I've
searched the mailing list for hours but I can't seem to hit on a
solution. Perhaps I'm searching for the wrong thing. Any insights
would be helpful. It seems like it ought to be easy.
Let's say I have an object in my
--- Kevin Wade [EMAIL PROTECTED] wrote:
What should the textarea's name be to get struts2
to update the specific report.author.bio String?
The problem is that you have no association between
the bio field and a specific report author.
One way to create that association is by using array
Hi all
i am getting an error like fallowing way. i have downloded latest
version copied all the jars still i am facing this p[roblem.i ma running on
tomcat5.5 and ide is eclipse.
some one help me.pl
Nov 17, 2007 10:58:08 AM org.apache.catalina.core.StandardContextfilterStart
Ted Husted wrote:
I know the JPA is growing in popularlity among Struts developers. I
was wondering if there are certain Struts 2 features that people where
finding useful in using JPA or Hibernate 3
For us it's Hibernate 3 still. We'll be moving to JPA in the code (with
Hibernate as the
Vijay,
Looks like you are using the spring plugin, and the following snippet
from the stacktrace clearly indicates that the spring classes are not
available -
java.lang.NoClassDefFoundError:
org/springframework/context/ApplicationContextAware
If you look at the spring plugin pom.xml, it
thank you,
my problem has been rectified. i am using all the api's which
are given by the apache. i am not using this spring classes i have removed
that jar file from my lib.it is working fine.One more query is there nay
problem if i use strut2 with tomcat 6.0?
vijay
On 11/17/07,
I haven't tried it, but I don't think that OGNL cares about your
imports. If your constant is static, then try -
s:if test=status == @[EMAIL PROTECTED]
On 11/16/07, Shyamal Mehta [EMAIL PROTECTED] wrote:
Hi,
I am using the struts if tag and want to use a constant from another
class inside the
69 matches
Mail list logo