Just getting started with struts, going through the oreilly book. I've
implemented my presentation layer with struts, and now I'm working on
interfacing it with my business layer. The book recommends converting your
form classes to DTO view classes before passing the data to the business
tier to
Hi All,
Is there any way to access a file(image,..etc) from the web application. the path of
the image is dynamically generated.
The requirement is that we have to upload a image file and store it to somewhere on
server at dynamically generated path. Now, Problem is how I should refer this
use html:image tag...
And generate the path dynamically something like...
%!String imagePath=; %
%imagePath=session.getAttribute(path);//can be any logic u have to generate
the image path...Better if u can put this logic in action and put just the path
attribute on form:-)) ...%
html:img
BeanUtils.populate(dtoObject, formObject);
How is that a big PITA? If the core object is actually storing data
in the correct types, you'll lose user input when conversions fail. The
goal of most folks is to present the user with their exact, incorrect
input for correction. That's why the
[EMAIL PROTECTED] wrote:
use html:image tag...
And generate the path dynamically something like...
%!String imagePath=; %
If I know my JSP correctly, %! is a declarator -- and those things you
declare in this fashion are instance-level variables. In other words
this is *not* thread-safe.
So, basically what you're looking for is some way to dynamically set the
directory that the files are stored in? You could do that easily with a
property file. Your end user would set the appropriate property in some
properties file that is in the classpath of the application server and
then
Ive got a JSP with several forms. For example:
html:form action=busquedaProgramasAction.do
/html:form
html:form action=busquedaNoticiasAction.do
..
/html:form
.
In this way Ive got 6 forms in the same JSP. The struts-config.xml is like:
action
Hi,
So, basically what you're looking for is some way to dynamically set the
directory that the files are stored in? You could do that easily with a
property file. Your end user would set the appropriate property in some
properties file that is in the classpath of the application server
Cool, didn't know about BeanUtils.
I've got tomcat 4.1.18 and struts 1.1 b2. Do I already have BeanUtils
somewhere? I see its in the Jakarta Commons package, should I grab a
certain version of it?
Darrel
Eddie Bush wrote:
BeanUtils.populate(dtoObject, formObject);
How is that a big PITA?
If you're using Struts, you have it. Struts relies on it.
Darrel Riekhof wrote:
Cool, didn't know about BeanUtils.
I've got tomcat 4.1.18 and struts 1.1 b2. Do I already have BeanUtils
somewhere? I see its in the Jakarta Commons package, should I grab a
certain version of it?
Darrel
Actually first just to appease me/us do a bean:write
property=taskCodeType right before you do the select options
portion in your jsp. Then also view source of the page and see what
you have listed as the values of the options (maybe your values aren't
matching what is displayed, assuming
Amit Badheka wrote:
Hi,
So, basically what you're looking for is some way to dynamically set the
directory that the files are stored in? You could do that easily with a
property file. Your end user would set the appropriate property in some
properties file that is in the classpath of the
In our application we have to show the errors, warnings, and
informative messages to the users in a separate pop-up
modal-window.
(This is not for logging purpose as provided by Log4J).
If we use ActionErrors, for this purpose, we shall have two
problems
1. How to categories them as Fatal,
You want some sample code, alright here you go:
html:form name=myForm action=bla-bla type=bla-bla
logic:iterate name=myProperty id=id1 indexId=x
type=java.lang.String[]
script
arrayVar[bean:write name=x /]=bean:write name=id1 /
/script
/logic:iterate
/html:form
Regards
Puneet
/html:formOn Mon,
This will create something like
script
arrayVar[0]=0;
/script
script
arrayVar[1]=1;
/script
script
arrayVar[2]=2;
/script
script
arrayVar[3]=3;
/script
What you probably want is this:
html:form name=myForm action=bla-bla type=bla-bla
script
logic:iterate name=myProperty id=id1 indexId=x
You can use the property attribute of html:errors/
In your Action or in your FormBean you save your errors under an appropriate
key :
In an action :
ActionErrors errors = new ActionErrors();
errors.add(Constants.FATAL_LEVEL, new ActionError());
or
errors.add(Constants.ERROR_LEVEL, new
Hi,
I am just setting up a new Struts project. I have the Action servlet set
up and a struts-config.xml with almost nothing in it. When the war is
installed the servlet starts and then throws this error...
2002-12-23 13:47:11 StandardContext[/quest]: Servlet /quest threw
load() exception
The error sounds like the servlet cannot even find struts-config.xml. Check the war
to make sure struts-config is really there and in the WEB-INF folder. You can open
the war with WinZip. Also, make sure that the folder WEB-INF is in all caps.
-Original Message-
From: Howard Miller
Jacob,
Thanks for the kind words, your check is in the mail! :-)
To discuss the issue a little more here:
I am a great believer in layers. I'm also a great believer in having the right type
and number of layers. This means that I believe it is possible to have not enough
layers and it is VERY
Looks like the ActionServlet cannot find the config file at all. Make sure
the config parameter of the ActionServlet entry in web.xml is pointing to
the struts-config.xml file.
robert
-Original Message-
From: Howard Miller [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 23, 2002
I'm not certain, but are you sure that your DTD's are being found? We once
had a similar problem due to firewall issues.
Steve
Robert
I saw something similar on Friday, but haven't debugged
it yet.
I tried a quick switch from Weblogic to Tomcat, and the
null pointer exception I was getting was caused by my
Action receiving a null Form Bean. I believe that
if you link to myPage.do , the Struts framework will
create an empty
I am trying as given on the apache server ... but getting this error..Please
tell me if i am missing something.
com.ibm.servlet.engine.webapp.WebAppErrorReport: No getter method for
property adminRight(2) of bean org.apache.struts.taglib.html.BEAN
my jsp says :
html:text property=adminRight(2)/
Hi all,
Here is my problem: I have a user which is granted access to some files to
download. I want to put all the files downloadable by all the users in a
common directory (many users may download the same file), but with the
possibility to deny the download to users not identified by my
I built an application on WLS 6.1 using Struts 1.0 that supported display of
user-uploaded content. Several keys to this were:
1) I had to deploy the web app in exploded format
2) If WLS was run in Production Mode I had to call a little runtime script that
deployed (refreshed) the new content
Try using --
html:text property=adminRight[2]/
-Original Message-
From: Jitendra Singh [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 23, 2002 9:32 AM
To: Struts Users Mailing List
Subject: Re: no getter method for property phoneList
I am trying as given on the apache server ... but
got it ..
thanks
Jitendra
- Original Message -
From: Siggelkow, Bill [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Monday, December 23, 2002 8:14 PM
Subject: RE: no getter method for property phoneList
Try using --
html:text property=adminRight[2]/
Hello,
I have a probably very simple question:
I have a form like this:
html:form action=/personalplanungEditShow name=personalplanungEditForm
type=PersonalplanungEditForm
td class=mitteobenhtml:image src=images/icons/editsmall.gif property
=editieren%=index.intValue()% alt=Editieren //td
Hi Christophe,
This looks very similar to a problem I had (and I bet we are not the only
ones).
Some codes snippets from the RetrieveFileServlet I wrote (a modified version
of code from Wrox 'Professional JSP, 2nd edition').
In your doGet():
// I omitted the exception handling and stream
You could use a hidden field with the value equal to the value of the scripting
variable ..
html:hidden name=personalplanungEditForm property=someProperty
value='%=theScriptingVariable%'/
-Original Message-
From: Tobias Flohre [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 23, 2002
Great, it just works as I wished! Thanks a lot!!
Christophe VIGOUROUX
ECILIA - Ingénieur développement
Tel: 04.78.68.46.14
Fax: 04.37.43.69.01
-Message d'origine-
De : Remke Rutgers [mailto:[EMAIL PROTECTED]]
Envoyé : lundi 23 décembre 2002 16:10
À : 'Struts Users Mailing List'
Objet :
Hi again,
using a hidden field is a good idea, but I just can set a simple java type
into the value. I need to write a complex object into the property of my
bean!
Does anybody know how I can do that without using java?
Thanks,
Tobias
Mark,
We just happen to be fighting a similar problems today. Someone please
correct me if I am off base here, which jugding by my results I am, but
shouldn't this work (psudo-code):
1. MyForm myForm = (MyForm)form;
2. myForm.getValues() -- myStateObject.setValues();
3. myStateObject.save();
4.
I've been chatting with Rick Reumann, author of the very nice
DateBeanUtilsConverter solution to dealing with java.util.Dates within
Struts (and by extension BeanUtils). I'm broadening the discussion to the
struts group because I'd like to bounce my observations off of a wider
audience. The
On Mon, 23 Dec 2002 11:49:04 -0500
Jim Krygowski [EMAIL PROTECTED] wrote:
This is my test:
...
String input = null;
// check to make sure the datatype is right
input = 2002-03-17;
Date dateValue = (Date)ConvertUtils.convert(input, Date.class);
Hi Rick-
I should have deleted the first block of code. It's not exactly misleading,
but it unfocuses my point. I apologise for that. I'm spread a little thin
so the email quality control is suffering ;-).
The key thing to notice is this:
1.HashMap values = new HashMap();
2.
It seems like the only way things work out properly in the rendering phase
is to have a ValueObject that contains the Date properties and an ActionForm
that has a String for each Date on the ValueObject. This is what I was
originally hoping to avoid. My ActionForm contains graphs of ValueObjects
I'm having a problem displaying the page. I'm using the logon example from
the Struts in Action book, but substituted the .jsp pages with my own
versions. Now, before I did the substitutions, it displayed the default
welcome page, provided with example, when I substituted with my own and
On Mon, 23 Dec 2002 12:32:13 -0500
Jim Krygowski [EMAIL PROTECTED] wrote:
It seems like the only way things work out properly in the rendering
phase is to have a ValueObject that contains the Date properties and
an ActionForm that has a String for each Date on the ValueObject.
This is what I
I've had those same problems in the past.
Here's how I troubleshoot it.
1. Browser
Make sure that the browser isn't caching the page.
Verify your settings, and if still in doubt, close the browser and open
a new one.
2. Container
Is the container re-compiling the jsp?
Check the settings in
Also compare the modified date of your file with the one your container has compiled.
If your modified date is older than the one Tomcat is using, Tomcat will not recompile
it -- assuming you're using Tomcat. Not sure how other containers behave. +1 on the
delete idea. That's usually what I
Hi Rick-
Yep, you've got it. I had the formatting tags you suggest in the back of my
mind all along. But when I saw the converters you created, they looked like
a really elegant solution. Unfortunately, I sort of forced my own set of
assumptions on them (cognitive dissonance?). Still, I can
Can you provide more details? When you are dealing with forms, the basic types are
either String or booleans. Perhaps what you want to do is best handled in your Action
that processes the form. It sounds like you need to make an object available in let's
say the request scope and then have
On Mon, 23 Dec 2002 13:33:59 -0500
Jim Krygowski [EMAIL PROTECTED] wrote:
As regards the tags, I would like to render an html input type=text.
As
far as I know, you can't nest tags so...
html:text name=myForm property=myDate value=fmt:formatDate
pattern=MM/dd/yy
That's what I thought! BUT...
No! The struts-config.xml file is safely in the .war file. A jar -tf produces.
WEB-INF/lib/xercesImpl.jar
WEB-INF/lib/xmlParserAPIs.jar
WEB-INF/struts-bean.tld
WEB-INF/struts-config.xml
WEB-INF/struts-html.tld
WEB-INF/struts-logic.tld
WEB-INF/struts-nested.tld
On Mon, 23 Dec 2002, Howard Miller wrote:
Date: Mon, 23 Dec 2002 19:03:20 -
From: Howard Miller [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED],
[EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: Error loading struts-config
Ahhh... easy enough answer to that question...
Because I don't know what I'm doing!!!
Anyway... spot on. That nailed it. Thanks for your help.
HM
On 23 Dec 2002 at 11:07, Craig R. McClanahan wrote:
On Mon, 23 Dec 2002, Howard Miller wrote:
Date: Mon, 23 Dec 2002 19:03:20 -
Hi Rick-
In the real world case, my form bean is merely a container for collections
of ValueObjects. It doesn't have any properties outside of getters and
setters for collections. The value objects within the collections have
java.util.Date properties which I'm interested in rendering to the
Thanks to all that responded, clearing the tomcat cache did the job:-)
Thanks a bunch. My tomcat was set to reload on each request, but not sure
why it didn't:-)
Appreciate everyone's help.
Ilya
-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Monday, December
I'm a Tiles newbie and am having difficulty implementing a tiles definition
factory properly. I've created the definitions XML file, added the
struts-config plug-in/, and the taglib/ in web.xml. And I see the
factory created in the appserver console. But how do I then access the
definition
Hello,
Warning: new Struts user. Trying to use it
with Velocity, actually.
I'm writing struts-config.xml for my web app
and I'm wondering about 'input' attribute of
the 'action' element.
What is it for, and how is it used?
I am asking because I see mixed examples -
some using that attribute,
Following is taken verbatim from the struts-config.dtd
input Module-relative path of the action or other resource to
which control should be returned if a validation error is
encountered. Valid only when name is specified. Required
Hi.
I have a form that wants to get the initial value for a html:text field
from a property of a bean associated with a different form on the page.
I have tried this:
html:text property=userName value=c:out value=${foo.userName}//
and this:
html:text property=userName value=${foo.userName}/
but
Thanks. Of course, I was looking at the DTD
yesterday, but today I forgot about it :(
Otis
On Mon, 23 Dec 2002, Siggelkow, Bill
([EMAIL PROTECTED]) wrote:
Following is taken verbatim from the
struts-config.dtd
input Module-relative path of
the action or other resource to
Hi
I'm sure there must be a better way but I have used code like this to solve
similar problem:
% String temp = ((cast.to.object.type)pageContext.getAttribute(foo,
pageContext.PAGE_SCOPE)).getUserName(); %
html:text property=userName value=%= temp % /
db
-Original Message-
From:
You can't use EL expressions with the base Struts tag library. They will only work if
you're using the contributed Struts-EL tag library, from the contrib directory.
You'll have to make sure your taglib directive specifies the correct TLD, and you'll
probably want to use a different prefix
Does struts provide any support for website searches? I'd like to implement
something like http://java.sun.com has in the upper right corner, that finds
all the matches of a text string in the website's pages.
Are there any opensource tools that do this kind of thing?
Darrel
--
To
You can use Struts as a frontend to a Lucene-powered search engine.
Lucene is another Apache Jakarta project. You can find more info here:
http://jakarta.apache.org/lucene
Justin
-Original Message-
From: Darrel Riekhof [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 23, 2002 6:40
Hello-
I have been using Struts for about a year now, however I have only used it
with Stxx. All of these taglibs are new to me.
I'm certain this is a very basic question but I have yet to figure it
out...
I have an Object in a FormBean I want to pull the Object from the FormBean
and then get
Hi
can anybody know why i am getting the following error
i am using struts-html tag like this
html:text size=22 property=shortname/
if i add the value attribute to the above tag its working fine otherwise
its giving the following error
javax.servlet.ServletException: Cannot find bean
Let's see. Is this inside a valid form element? Do you have the
ActionServlet set with a load-on-startup element?
-Original Message-
From: usha [mailto:[EMAIL PROTECTED]]
Hi
can anybody know why i am getting the following error
i am using struts-html tag like this
Hi Karr
you mean to say that struts-html form element then no. i have this
inside a html form tag form.
yes i have the load-on-startup element in the actionservlet set
Thanks
usha
Karr, David wrote:
Let's see. Is this inside a valid form element? Do you have the
ActionServlet set with a
LEGAL NOTICE
This electronic mail transmission and any accompanying documents contain
information belonging to the sender which may be confidential and legally
privileged. This information is intended only for the use of the
individual or entity to whom this electronic mail transmission
The text tag must be used within an html:form tag. Look at the user's
guide for more details:
http://jakarta.apache.org/struts/userGuide/struts-html.html#text
David
From: usha [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL
+1
trying-to-stay-politically-correct
...and a very Merry Christmas to you (if you believe in that sort of
thing).
/trying-to-stay-politically-correct
--
James Mitchell
Software Engineer/Open Source Evangelist
http://www.open-tools.org
C makes it easy to shoot yourself in the foot; C++ makes it
Yes - Merry Christmas and Happy New Year to all! Please be safe and
have fun! Look out for the plethora of idiots that are likely to be on
the road!!
--
Eddie Bush
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Season greetings to all Struts Developers ~!
Regards,
Daniel
-Original Message-
From: Eddie Bush [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 24, 2002 11:06 AM
To: Struts Users Mailing List
Subject: Re: [OT] HAPPY HOLIDAYS, EVERYONE
Yes - Merry Christmas and Happy New Year to
On Mon, 23 Dec 2002, James Mitchell wrote:
+1
trying-to-stay-politically-correct
...and a very Merry Christmas to you (if you believe in that sort of
thing).
/trying-to-stay-politically-correct
not-giving-a-rip-about-political-correctness
Let us all spend some time this joyous season
With apologies to Clement Clarke Moore
'twas the night before Christmas, and all 'cross the net.
Not a user was typing, the code was all set.
The patches were entered and each file was checked in,
In hopes that 1.2 New Years would bring.
The coders were nestled all snug by their LANs.
With
Hello,
I am having difficulties hooking up an HTML
form action to an action mapping defined in
struts-config.xml. This is the Struts HEAD
from CVS. I am using Struts with Velocity.
I can get .vm templates to load, but can't
get things like HTML form submission action
to map to a Struts action.
Hello All,
I am using the following ::
1) I have a BulkAccessor class named StyleGeneralInfoModel for my EJB.
2) I have created an Object of this BulkAccessor in my FormBean named ProductForm
class.
3) I want to access a property of my StyleGeneralInfoModel into my JSP page.
It was possible to do
On Mon, 23 Dec 2002 19:41:02 -0800 (PST)
Craig R. McClanahan [EMAIL PROTECTED] wrote:
not-giving-a-rip-about-political-correctness
Let us all spend some time this joyous season reflecting on the
magnitude of a God that would bother to create the likes of us, and
His willingness to sacrifice
Oh WOWthat is really good.
I think I'll post it to the Wiki
http://nagoya.apache.org/wiki/apachewiki.cgi?MerryChristmas
--
James Mitchell
Software Engineer/Open Source Evangelist
http://www.open-tools.org
C makes it easy to shoot yourself in the foot; C++ makes it harder, but
when you
On Tue, 24 Dec 2002 01:10:28 -0500
James Mitchell [EMAIL PROTECTED] wrote:
Oh WOWthat is really good.
I think I'll post it to the Wiki
http://nagoya.apache.org/wiki/apachewiki.cgi?MerryChristmas
I wonder when my wife and I have kids if she'll let me read that
version to them by the
Hi
anybody is using the struts-layout taglibraries. i wanted to know how to
use this with strutsv1.0.2.
thanks
usha
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]
I wonder when my wife and I have kids if she'll let me read
that version to them by the fireplace:) For some reason I
don't think it'll fly with her:)
--
Rick
The mind boggles at the logic extension of this line of reason:
DAD: Now kids, be good or Santa Craig will leave you copies of
I threatened mine with DOS.
--
James Mitchell
Software Engineer/Open Source Evangelist
http://www.open-tools.org
C makes it easy to shoot yourself in the foot; C++ makes it harder, but
when you do, it blows away your whole leg.
- Bjarne Stroustrup
-Original Message-
From: James
Thank God there are still some folks out there that know what the
holidays are supposed to be about! ... and thank God we are blessed
with such excellent leadership!
Like Aaron Tippin said: You've got to stand for something or you'll
fall for anything.
... or ... said more elegantly in the
LOL - stop it guys! My sides are gonna split right out!
James Turner wrote:
I wonder when my wife and I have kids if she'll let me read
that version to them by the fireplace:) For some reason I
don't think it'll fly with her:)
--
Rick
The mind boggles at the logic extension of this
79 matches
Mail list logo