Just use security-constraint in your web.xml deployment descriptor. For
example:
security-constraint
web-resource-collection
web-resource-name
Private resources
/web-resource-name
url-pattern
/private
/url-pattern
/web-resource-collection
What you are doing is fine for layout, however, when you hit save how is
struts supposed to know that id is supposed to map to
LoanForm.purposes[??].id, or that descriptions maps to
LoanForm.purposes[??].description. It does not, so nothing is set in to
your array. You must emit your properties
Subject: RE: Problem with empty file upload field
On Sat, 2002-07-06 at 23:52, Alex Paransky wrote:
I think the solution might be to update to the later version of Struts. I
know it's scary with the nightly build and all, but I have been using a
later version of struts without any problems. I
I think the solution might be to update to the later version of Struts. I
know it's scary with the nightly build and all, but I have been using a
later version of struts without any problems. I have a page where a user is
able to fill in up to 25 names of files to upload, not all are required.
David, in your example, there is no need to add the userId to the url.
Since forward passes the entire request to the page that's being forwarded
to, and userId is already part of the request query, your next page will
automatically get the user id that was passed into the action. Thus if you
Well, if you configure your action with a proper form, the form would
already be passed to you in your action method. Simply cast ActionForm to
the TestActionForm, and populate it as you did. You don't have to set it
into the request since that's done for you automatically.
Good Luck.
-AP_
I have an ActionForm which I would like to pre-populate before struts
populates it with values from the request. The pre-population of the form
depends on one parameter in the request. I get the parameter inside of the
reset(...) method on the form, and proceed to pre-populate the form. This
Rick,
I recently had a similar problem. Using J2EE security, I was not sure how
to detect a user login. After all, a user can go into ANY protected page,
and I did not want to put the same tag in to EVERY single .JSP page that was
protected.
The solution, at least in my case, came in a form a
Why not use J2EE/WEB standard container authentication? It will do what you
want. In fact, it was designed to do what you want, which is called Lazy,
or just in time, authentication. The user can surf your page, however, when
he links to a protected item, a login page (of your choosing) will
I am trying to convert an application that was using jsp:useBean to Struts.
In typical Struts pattern, I created a xxxLoad.do for different type of
beans that I was putting into the request context.
For simple pages, I can simply execute a single xxxLoad.do and forward to
the desired
Struts does this by default,
name=person property=firstName
name=person property=lastName
name=person property=company.name
name=person property=company.addresss.line1
name=person property=company.addresss.line2
name=person property=company.addresss.line3
-AP_
http://www.alexparansky.com
I am not familiar with the way Flash .swf array works, however, if it embeds
a reference to the file and then executes an http GET to actually download
the file, then putting image just like any other picture on the page should
work (assuming you are not using user logins, and require
Well, the documentation of the define tag states:
Retrieve the value of a specified bean property, and define it as an
attribute (in the scope specified by the toScope property) accessible to the
remainder of the current page
So, the bean reportsForm must already be present in the scope at
Well, there is a size tag you can use to get the size of a collection.
What you do with it, or how you use it to layout your table is up to you.
-AP_
http://www.alexparansky.com
Java/J2EE Architect/Consultant
http://www.myprofiles.com/member/profile/apara_personal
-Original Message-
Start by creating an action that would replace your servlet. If the user
enters any parameters for the report then create a Form. The action
attribute of the form would be your new action to execute the report. The
action would define a FORWARD to the proper presentation .JSP page. Once
the
Have you tried:
bean:write name=numberOfArticles scope=application /
-AP_
http://www.alexparansky.com
Java/J2EE Architect/Consultant
http://www.myprofiles.com/member/view.do?profileId=127
-Original Message-
From: Juan Alvarado [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 11, 2002
You should be able to do that. In-fact, that's one of the ways to re-use
common page presentations. If you do your job write, then your main page is
composed of a bunch of includes to render different parts of the result
"tree". Be-careful, however, the last time I checked the nested tags only
Your first statement,
...I have a form that can have N number of images...
Does not warrant the use of nested tag library. Simply use the standard
iterator, and indexed properties of the html:file tag, to properly output
your file names as file[1], file[2], file[3].
-AP_
I am using struts with J2EE authentication. I am using Orion server,
however. Here are some of the things which I did.
When you setup your J2EE authentication, you typically tell it what path to
protect, so for example if you make /member/* a password protected
resource make sure that all the
Your AddToCartAction class does not appear to be a public class. Have you
tried making the class public?
-AP_
http://www.alexparansky.com
Java/J2EE Architect/Consultant
http://www.myprofiles.com/member/view.do?profileId=127
-Original Message-
From: Jason B Menard [mailto:[EMAIL
Adolfo,
The problem with putting or implementing a tag that performs complex AND,
ORs, NOT expressions, is that getting the data for those expressions to work
on could be tricky. There are just so many places that the data can come
from (page, request, session, application, beans, custom api
You have a number of options:
1. If you want to store the data for a while, then put it in to a session.
While you should not probably put the entire ResultSet into the session, you
might read a single row in a java bean, and store the bean in the session.
2. If it's a single row that you have
I used Iterator a few times and it seems to work ok.
-AP_
-AP_
http://www.alexparansky.com
Java/J2EE Architect/Consultant
http://www.myprofiles.com/member/view.do?profileId=127
-Original Message-
From: days [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 07, 2002 6:39 PM
To: Struts
You are posting to the wrong user list. Do not post to DEV, use the USERS
mailing list instead.
While I was not able to find any rags in struts, your problem has to do with
the size of the servlet method exceeding 64K. You will have to resort to
using dynamic includes if you still want a large
I am not an expert in Struts, but in my development I have been using the
.do extension when specifying any references to Struts actions from .jsp
pages, so my code would look like:
html:form action=/verifyAction.do focus=username
If you are using the .do extension method, try this.
-AP_
Markus,
To implement a suitable map, we created a new tag called URI. By using this
tag and specifying the id= attribute, a new scriplet object is created in
the appropriate scope. Then, we are
able to pass this object into the html:link tag.
This is one way of doing it.
The Struts way would
I am currently using Templates (not Tiles) to layout our pages. While
general components such as menu, header, footer are well defined, same for
all pages, and are included from a global single location, the body is
always different. So, for every page, we wind up with 2 pages.
page.jsp - uses
configuration files will replace
all your page.jsp(s).
Mark.
-Original Message-
From: Alex Paransky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 11:19 AM
To: 'Struts Users'
Subject: How to avoid a separate .jsp page for body definition when
using Templates?
I am currently using
Well, the value you store in the actual field would have to be
priority.low, priority.normal, or priority.hi instead of normal,
high, or low. Then you can simply use the bean:message instead of
bean:write. The bean:message tag will treat the property= as the key in
to the resource bundle.
I seem to have a small problem. It's quite simple. All I want to do is
update the database when a user logs on. However, with the Servlet
authentication mechanism, there does not appear to be a way to execute a
process or a method after user is authenticated.
I am just wondering if Struts or
I have a Form and two actions FormLoad.do and FormSave.do. Both of these
actions have scope set to request.
The FormLoad.do initializes the form with data by configuring various
collections (later used for options on the view), it is set to
validate=false.
The FormSave.do attempts to save the
I need to create a custom RequestProcessor, however, I am not sure of how to
tell struts to use it. Could someone give me a clue as to what
configuration needs to be changed to allow this?
Thanks.
-AP_
http://www.alexparansky.com
Java/J2EE Architect/Consultant
must be done after action-mapping declarations.
Cedric
Alex Paransky wrote:
I need to create a custom RequestProcessor, however, I am not sure of how
to
tell struts to use it. Could someone give me a clue as to what
configuration needs to be changed to allow this?
Thanks.
-AP_
http
O, thank you, thank you, thank you. I love struts!
-AP_
http://www.alexparansky.com
Java/J2EE Architect/Consultant
http://www.myprofiles.com/member/view.do?profileId=127
-Original Message-
From: Alex Paransky [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 12, 2002 11:58 AM
There is no way in struts to populate the complex JAVA object with data
simply from a submit form. If you pre-initialize your complex object then
the submit form will be able to populate customer.name,
customer.address.line1, customer.address.zip but ONLY if you have these in
your form as valid
Shouldn't you be using a nested:form ? in your .JSP?
-
-AP_
See my profile at
http://www.myprofiles.com/member/view.do?profileId=128
-Original Message-
From: Javier Campoamor [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 11:49 AM
To: Struts Users Mailing List
Also, I think you need to be using indexed properties to properly generate
the names of the nested:hidden property names inside of your loop. Without
using indexed properties, how will struts know which member to update in
your array when a submit is done?
-
-AP_
See my profile at
The URL in the address field of my browser reads:
http://junior:8080/member/private/request/createDirectForm.do
But I am not able to retrieve this, from the request. I dumped the
information in the request, and here is what I see after a number of
template, includes, and other stuff:
Header:
To me, an action should be able to load and execute the form. Furthermore,
I don't want to create separate action classes to load or execute the form.
So here is what I did:
public abstract class FormAction extends Action {
public ActionForward executeForm(...) {.load form.}
public
I was wondering how people are implementing paging capability in struts. In
other words, if the result set comes back with 2000 rows, how do you display
page 4 of 100 with 20 results per page?
Is writing custom SQL commands to depend on ROWNUM or something of that sort
always required? Are
Dear Struts Users:
We have used the transport-guarantee CONFIDENTIAL in our web.xml to force
certain pages to be accessed using https. Now, these pages cannot be
accessed using http unless we hardcode https://www.server... in our URLs.
However, we are trying to keep our URLs relative and not
Hopefully, you are using the dynamic include and not the static include,
right?
-AP_
-Original Message-
From: Dave J Dandeneau [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 9:30 AM
To: Struts Users Mailing List
Cc: Nilesh R Gohel
Subject: JSP size optimizations
We are
I need to display a recursively defined data structure bean.
I have a bean which looks like this:
public class Message implements java.io.Serializable {
private String header, body, from;
private Collection replies;
public Collection getReplies() {return collection;}
public String
I guess, this is one way of doing it, I am trying to avoid too much Java
code in my .JSP page.
-AP_
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 12:22 PM
To: [EMAIL PROTECTED]
Subject: RE: Displaying recursively defined bean...
Try property=userId
-AP_
-Original Message-
From: Matt Petteys [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 3:12 AM
To: [EMAIL PROTECTED]
Subject: \No getter method\ error when using Bean:Write
Can someone point out what I am doing wrong here.. Or is this some kind of
of your own tag or finding someone elses. Struts doesn't have one.
Arron.
Alex Paransky wrote:
I need to display a recursively defined data structure bean.
I have a bean which looks like this:
public class Message implements java.io.Serializable {
private String header, body, from;
private
In the nightly build the BufferedMultipartInputStream does not handle -1
(unlimited size download) too well it fails in the constructor, also the
present tag does not appear to detect or not detect parameter values. Has
any one seen these problems?
-AP_
http://www.alexparansky.com
--
To
I have the following action define in my struts-config.xml:
action
path=/foo
parameter=/foo.jsp
type=org.apache.struts.actions.ForwardAction
/
From the browser, user can access /foo.do and the contents of the foo.jsp
are displayed, however, when I try to get the URL information from
Read the doc.
-AP_
http://www.alexparansky.com
-Original Message-
From: shiva prasad [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 8:59 PM
To: Struts Users Mailing List
Subject: Begin With ??
Hi
I am new to Struts. Would anybody tell me how to begin
with?
thanks
shiva.
.
It seems to be working, but I am wondering if this is the best way of doing
this?
-AP_
http://www.alexparansky.com
-Original Message-
From: Alex Paransky [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 6:04 PM
To: Struts Users Mailing List
Subject: Getting current page from
Message -
From: Alex Paransky
To: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Sent: Wednesday, February 06, 2002 11:53 PM
Subject: RE: Design question about ActionForm's validate method
Ok, I understand how forcing all requests through the controller is a good
thing. Now, I have various
the
actual request through the controller becomes more and more desirable,
until it's really not worth making the occasional exception any more.
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/
Alex Paransky
So do you mean, all pages go through the Action? Even those which are not
forms and for display purposes only? Could you shed some light as to why
this is preferred?
Thanks.
-AP_
http://www.alexparansky.com
-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent:
I need to build a URL which contains, as one of it's parameters on the query
string, yet another full URL with parameters. Something like this:
/url1?p1=ap2=/url2?pp1=app2=bp3=b
I know its confusing (and wrong syntax), however, the intent is for /url1 to
have the following parameters:
p1=a
A forward is something that occurs on the server side and the browser is not
aware of it. A redirect, is something that comes back to the browser, and
causes it to make a new requires (redirect) right way. The browser is aware
of it and that changes the URL that the browser is pointing to.
For
Some time back, we ran in to a problem between different servers. The
problem, was that for some reason, the definition of the constants SKIP_BODY
and such mapped to different integers. While running your code on one
platform, try to print out the values of the common tag constants such as
Make sure to put your form in the session scope.
-AP_
-Original Message-
From: Sriram Nookala [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 1:47 PM
To: Struts Users Mailing List
Subject: persistance for wizard type forms
I'm developing wizard-type forms using struts.
Assuming your client is using cookies this should work automatically. If
your client has his/her cookies disabled you must make sure to submit a
re-written url as the target for returnTo processing in your other
system.
-AP_
-Original Message-
From: Reid Pinchback [mailto:[EMAIL
When I use ActionForward I supply it the Context-relative URI to which
control should be forwarded. However, when I want to use a href=... I
cannot use the Context-relative URI. Thus my returnTo= backlink works
correctly if I use it with the ActionForward, but fails to work when used
with a
I looked at html:link, and it seems to require using a Map class to pass
parameters to the link. Seems like a lot of setup, and scriplet code (which
I am not crazy about) just to generate
/school/maintenance.jsp?schoolId=223context=ready. Is there an easier way
to do this?
Here is how I
Do you mean to say, when you make a request context1/location/page.jsp and
context2/location/page.jsp you get the same page even if you update
context1 and not context2?
Seems like a server problem to me.
You should be able to remove struts from the equation by creating a simple
.jsp page
How do I get back the URL with which the page was called? For example, if
the request looked like this:
http://www.testServer.com/mainPage.jsp?arg=2arg=3
I would like to get back the /mainPage.jsp?arg=2arg=3 part. I know I can
call request.getRequestURI() and concat that with
I have ran in to some issues with the nested library, I am wondering if any
one has come across these issues:
1. The nested-tags.tld is missing the Nested on the class name
representing tag define
2. The class name for tag form is incorrect
3. The iterator tag does not create a scripting
I replaced the following (which is working as expected):
jsp:include page=%= /private/component/detail/memberComponent +
bean.getComponent().getTypeId() + ViewContent.html % /
With:
bean:include id=detail page=%=
/private/component/detail/memberComponent +
bean.getComponent().getTypeId() +
In a certain create action I create a new object, and want to forward to the
object's EditForm. The EditForm expects the ?objectId=value parameter be
set on the request. Currently, I wrote the following code in my create
action to augment the current action with the ?componentId=NNN parameter:
I have the following structure for my web site:
common
template.jsp
cart
cart.jsp
cartContent.jsp
When I use the template:insert tag from cart.jsp, the content is being
included relative to the location of template.jsp which is in common, and
not cart.jsp which is in cart. I have to
Should the action attribute on struts-html:form tag be made to understand
relative as well as absolute URIs? Currently, my .JSP code looks like this:
...
html:form action=/private/cart/cartHeaderSave.do ...
...
My action in struts-config.xml looks like this:
action
Standard J2EE/WEB based security should do the job. I have this running
nicely with Orion server. From my public page, I put a link called Login
to the index.html in the protected area. If the user is not authenticated,
he/she is first taken to the Logon page specified by the configuration in
I understand what you are saying, but then sometime the value is in the
parameters, and sometimes in the request.
I basically have a page with two modes of operation. When I pass
?type=initial to the page it behaves in a certain way. There is a link on
the page to take it into a second mode.
path=/public/registerSuccess.html?type=next/
/action
-Jonathan
- Original Message -
From: Alex Paransky [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, January 17, 2002 11:37 AM
Subject: RE: Forwarding from a FormAction with parameters
I have a bean on a page which does not have the same structure as a form in
terms of fields and names of those fields. However, I want to use values
from that bean to DEFAULT my form values to. How can I do this without
resorting to scriplet mode?
In other words the bean looks like this:
property=profiles
/nested:iterate
...there's no need to set the name property here. It will be ignored by
the nested tags anyway, as they must rely on the founded name set by the
parent tags.
Arron.
Alex Paransky wrote:
Some background:
I am using Struts 1.0.1. The nested tags were obtained
I need to implement a feature where a cookie stored on user's browser,
contains userId and Password information. Then tie it with the J2EE/Servlet
FORM LOGIN security using Struts. I can send up a cookie with the
information, I just don't know how to integrate this in with JSP/J2EE
I am pretty new with struts and wrote the following .JSP code. Is there a
better way to write this? I could not find a tag in STRUTS to let me just
get the property from the object. My object does not have get/set methods,
so I had to resort to using %= tag. Is there a tag in STRUTS that
I am just starting with STRUTS and have a basic question...
I looked at the struts documentation, and it mentions that there should be a
messages (not message) tag. I only was able to find errors tag. I want to
show a message to the user, which is not an error. Should I still be using
the
Somewhere, I read that dynamic forms are a weakness of Struts. It should be
coming in the next version. For now, one has to resort back to general
basic JSP development for creating dynamic forms. What specific situations
did you have in mind?
-AP_
-Original Message-
From: Yan Zhu
You know, I just had the same problem. I was trying to use STRUTS with
Orion server, and I was not .WARing my application. I looked at the
example, and the only difference was that their application was a .WAR my
was not. Once I have created a .WAR things started to work rather
magically.
Is there a good Struts tutorial that one can recommend. The documentation
does not show how to use the tags and when.
Thanks.
-AP_
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]
78 matches
Mail list logo