The server doesn't really get to sy what window a response goes to (at
least not to my knowledge). On the client side, you can have one window
tell another to request a specific URL. So your form submit should open
a new window, then give that window a URL to request.
slickdev wrote:
I
Hi Michael,
You need:
logic:iterate name=users id=aUser
bean:write name=aUser property=firstName/
%-- etc --%
/logic:iterate
The name attr in logic:iterate must match the attribute name of the List.
Any BTW you're going to get really tired of writing Beans classes like
User. Many folks on
http://dynclass.sourceforge.net/ - a Class-creation API with very simple
but powerful Map-to-JavaBeans translation.
I have recently added support for arbitrary property names (i.e. names
that contain spaces, operator chars, you name it). So for example:
Map myMap = ...;
myMap.put(email
.
-Original Message-
From: John Raley [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 01, 2002 10:09 PM
To: Struts Users Mailing List
Subject: Re: ArrayIndexOutOfBoundsException while using logic:iterate
Hi Shashi,
Where does the page generation stop? I don't think logic:iterate itself
Hi Shashi,
Where does the page generation stop? I don't think logic:iterate itself
will walk off the end of a list (and even if it did that would throw
IndexOutOfBounds, not ArrayIndexOutOfBounds). It might be thrown from
some other code.
John
Shashikiran M wrote:
Hi All,
Has any one
With Struts logic:equal tag:
logic:equal ...img src=.../logic:equal
Check the doc for the various logic:equal options.
Leonard Wolters wrote:
Is it possible to concatenate jsp files to one ?
The problem i have now is that tomcat / catalina
is complaining when I write multiple times to
the
Morycz, Felicia V wrote:
I have done some archive searching and cannot seem to hit this topic.
My business tier is going to be sending me a chunk of data that is delimited
into key/value pairs. I want to parse this data and put it into a
Hashtable. I want to be able to access this data from a
If the elements of the list are just Strings (or other atomic types)
then you won't be able to break them down into sub-properties. If they
are composites (i.e. they have getFoo(), getBar(), etc.) you could write
these properties with:
bean write name='myFormArrayListElement' property='bar'/
Hi Gene,
You're getting hose by JavaBeans capitalization rules. If the second
letter of the property is upper-cased, the first letter will not get
lower-cased. So try property='LEyesite' See
java.beans.Introspector.decapitalize() for the gory details.
HTH,
John
--
Check it out: Map -
Use book.equals(java) (or better java.equals(book) in case book is
null).
== only determines whether two references point to the same object.
wu qihua wrote:
I want to get the information about a field the form bean,and let it
print the information in the funtion of validate.but actually
Hi Folks,
I'm announcing an API that can convert a java Map to a JavaBean. Before
this, I was creating lots of silly inner classes like this (and I know
I'm not the only JSP developer doing this):
public class EmployeeBean {
public String getName() { ... }
public String getEmail() {
Try cleaning out your tomcat work directory (i.e. delete everything in
D:\jakarta-tomcat-3.2.3\work\localhost_8080%2Fexamples).
[EMAIL PROTECTED] wrote:
I followed the instructions in the installations (tomcat-apache.conf).
However, when I try to run an example like struts-example, I am
This might be useful:
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14326.html
Brian K. Buckley wrote:
Is there a good way to capture the output from a snippet of jsp into a
String variable that can be reused multiple times in a page?
- Brian
As a simple example, if one
You're almost there. The content is in your page context; the problem
is your tag doesn't declare a scripting variable. You have three choices:
1) Write a TagExtraInfo class for your eval tag that declares the
variable. Don't forget the teiclass element in your .tld!
2) Use the struts
Off-topic, but I just learned some awk...
awk '/;[:blank:]*/ { count++ } /(if|for|while|switch).*\(/ { count++ }
END { print count; }' `find . -name \*.java`
This should get reasonably close. awk exists for Windows but I don't
know what the equivalent of find is. Probably faster to install
Check out
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14326.html
Clay Graham wrote:
can you give a more verbose example of how you would do this?
I would like to do this too.
the exact syntax is important, I cant seem to make it work.
-Original Message-
From: John
Craig R. McClanahan wrote:
On Fri, 24 Aug 2001, John Raley wrote:
Funny, I was just griping about this to a friend last night: that tags
aren't composable like functions and classes. IMO it's a major weakness
in JSP. There was some discussion earlier on this list, see Using tags
from Java
Sorry - nesting like this is not allowed in JSP (another of its
weaknesses IMO).
Tom Tibbetts wrote:
Hi All. Is it possible to nest a bean:write inside of html:link such
as you have the following:
html:link href=somepage.jsp?action=someactionid=bean:write
name=somebean property=id /
As a workaround, I wrote an 'eval' tag that captures its content to a
bean. You can bind the content to a scripting variable and use the
variable. It's ugly but it works.
So, you'd do this:
x:eval id='idValue'bean:write name=somebean property=id //x:eval
html:link
This problem comes up with Date fields every now and then. Basically
you have two properties: one with type String and one with type
WidthType. The String property is backed by a WidthType (i.e. there's
no String inside the form object - getWidthAsString() converts the
WidthType on the fly,
eval captures the output from one or more tags, which define doesn't do.
[EMAIL PROTECTED] wrote:
Actually, struts-bean.tld has a define tag which does the same thing (no
custom eval tag necessary):
bean:define id=idValue name=somebean property=id/
html:link
Joey Gibson wrote:
An ever-so-slightly-less-clumsy way to do this it to have an index.jsp
that looks like this:
jsp:forward page=/myaction.do/
But if index.jsp is precompiled (and removed) this won't function as a
welcome file (i.e. something that will be shown if they request
Funny, I was just griping about this to a friend last night: that tags
aren't composable like functions and classes. IMO it's a major weakness
in JSP. There was some discussion earlier on this list, see Using tags
from Java code. The short answer is you do it all yourself.
David Corbin
Anyone have a solution for this? I'm having the same problem. Thanks.
[EMAIL PROTECTED] wrote:
Hi everyone,
I am pre-compiling my jsp's in my struts web app, and everything works fine,
except specifying the welcome file in the web.xml.
If I do not pre-compile everything, having index.jsp
Ken,
Are you subclassing ActionServlet solely to perform this conditional
forwarding? If so I would recommend putting this logic into an Action
subclass called something like ActionBase (instead of putting it in
ActionServlet) and making your actions subclasses of your custom
ActionBase
WHAT?!? An insincere offer via unsolicited email? I'm shocked,
appalled and chagrinned...
Anthony Xin Chen wrote:
Hello struts-user,
If you have received a email claiming a great off from
webhosting.com, it is a hoax.
There are lots of variables that affect load time. Save a copy of the
generated page, put it on the server and try loading it as static HTML
(i.e. eliminate the page gen time). Also, try replacing the bean:write
calls with static text.
John M. Corro wrote:
We have a JSP page that's using
For what it's worth: I keep track of what page I'm on via request
params. Every time the page is requested I rerun the query from scratch
and limit the reported results according to the page number and number
of items. No caching, so performance probably could be improved, OTOH I
don't
logic:iterate name='vectorVector' id='simpleVector'
logic:iterate name='simpleVector'
...
/logic:iterate
/logic:iterate
Rama Krishna wrote:
hi,
can anyone tell me how to iterate a vector of vectors??
thanx,
rama.
(Sorry if this duplicates a previous response)
The fact that the bean name is null makes me suspicious:
1. Are you using html:options within an html:form tag?
2. Does your action specify a name (in struts-config.xml)?
Or,
does your form bean class have a customers property?
Shannon Moschetti
This is definitely a challenge. You can use a single form with multiple
submits, each with a meaningful name. The name will be sent with the
request - use the name to select the appropriate action.
Marc Eckart wrote:
But we need something like nested forms, because we have actions for a
Hi Jonathon,
Struts calls Action.perform from the ActionServlet. Servlets are
allowed to throw only these two exceptions from their service() methods
- so you'll need a proprietary Servlet framework as well... :^)
In my app I have a base Action class with a final perform() method. All
of
Having functionality in taglibs is great, until you want to use the
functionality outside of a JSP (i.e. in the implementation of your own
tag). It would seem fairly easy to write a 'tag player' that would
instantiate a tag and run it from within code - is this really
necessary? Any other
Yes, my own tags tend to be factored such that most of what they do is
available from other contexts. This is not necessarily the case with
other taglibs I'm interested in... Mostly I was looking for a general
solution to this problem - I'd prefer to use a tag as its author expects
over
But you can do:
url-pattern/view/*/url-pattern
Just put your protected pages under a protected directory.
Hicks, James wrote:
You can use the security-constraint/ and security-role/ tags in your
deployment description to block access to a JSP page. The only problem with
this is you have to
-
From: John Raley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 09, 2001 9:52 PM
Subject: ActionForm.reset() not called when form tag creates bean
When the form tag creates its form bean it doesn't invoke reset() on the
form. This (or similar) behavior would be really useful
You could either define a forward for this action in struts-config.xml, or
construct a new ActionForward on the fly.
Alex Colic wrote:
Hi,
how do you forward from one action servlet to another? I have a form that
gets submitted to a servlet that I may depending on a value pass it off to
When the form tag creates its form bean it doesn't invoke reset() on the
form. This (or similar) behavior would be really useful to me - I'm
populating the form with runtime-computed default values.
Right now I'm considering hacking in a create and a call to reset() on
the page (or in a
My request attributes seem to go away sometime between forwarding from
an Action and when the JSP is processed. Any ideas what's going on?
John
Ack! The 'forward' was a redirect...
John Raley wrote:
My request attributes seem to go away sometime between forwarding from
an Action and when the JSP is processed. Any ideas what's going on?
John
to be in its own thread of
execution.
Any insight you, Paul, or anyone else could give here would be greatly
appreciated.
Sean
- Original Message -
From: John Raley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 03, 2001 12:20 PM
Subject: Re: Servlets, Beans, Struts
Sean,
You would probably not write the task as a Servlet. Instead, as part of your
startup you'd put the task in application scope. Remember that Servlets/JSPs
that talk to the task are going to do so from different threads (potentially at
the same time). The task would probably manage its
Try using bean:define and specifying the type you want. The 'id'
attribute value in bean:define will be the downcast reference.
Example:
% ... a bean of type Foo is in the page under the attribute name 'aFoo'
%
bean:define name='aFoo' type='mypkg.SubFoo' id='aSubFoo'/
aSubFoo now refers to
I would argue that logging a user in is business logic. However, the user
state (i.e. whether the user is logged in) is part of the model - a "permission
denied" message is the appropriate view of the model when the user is not
logged in; thus this belongs in the JSP.
I check permissions at the
I started out using the JSP errorPage directive. Then I realized
I wanted to handle errors from my Action classes and my JSP's on the
same page, so I had my jsp error page forward to another page that
actually handled the errors. The actions forwarded directly to the
error-handling page.
This
Sorry, thought it was #2...
"Charlemagne L. Rey" wrote:
i would like to have a separate jsp page for errors.
from the choices that you've given me, it's #1.
Anthony Martin wrote:
I interpreted two possible questions form your message:
1. You want to have a JSP devoted to
Hi Susan,
To patch the webgui, do this:
1) remove the tomcat/webapps/ROOT/WEB-INF/classes directory
2) copy the file 'classes.jar' from gate into
tomcat/webapps/ROOT/WEB-INF/.
3) run $JAVA_HOME/bin/jar -xf classes.jar (this will replace your old
classes dir)
4) restart the webgui - check the
Doh!
John Raley wrote:
Hi Susan,
To patch the webgui, do this:
1) remove the tomcat/webapps/ROOT/WEB-INF/classes directory
2) copy the file 'classes.jar' from gate into
tomcat/webapps/ROOT/WEB-INF/.
3) run $JAVA_HOME/bin/jar -xf classes.jar (this will replace your old
classes dir)
4
Mike,
When you have a choice between returning something in the session and
returning it in the request, put it in the request. Session data lives a
lot longer - it causes your per-user memory usage to go up. Lots of
session data can also lead to hard-to-find bugs.
Does the bean bound to
I run into this kind of thing a lot. It's a constant reminder that the
tag syntax is not a substitute for the control structures we're used to
in programming languages...
It's ugly, but I would probably handle this with scripting vars:
% String theAction = null; %
logic:equal
It's hard to tell from your message: is struts.jar in /WEB-INF/lib ?
JOEL VOGT wrote:
Hi,
I am having troubles running the hello-world app from the struts trail
map at http://developer.bluestone.com.
The basic directory setup is this
hello-world \WEB-INF\ lib \ classes \
Use Strings. However, I think an empty textfield will set its String
property to "" (empty string), not null.
Bryan Field-Elliot wrote:
Question reposted (never got any responses) -- please respond, someone :)
Question about creating ActionForm beans --
What kinds of data types are
You could use String as the property type, and have another method to retrieve
the data as a date for the database's use:
MyForm {
private String dateStr; // may not be valid date
String getDateStr() { return dateStr;}
String setDateStr(String value) {... /* validate with DateFormat
Struts will not do anything special in this case (that I know of...)
To guard against multiple submission you can put a unique id in a hidden
field. If you've already processed the request with that id, you ignore it.
(For example, if you're an ecommerce site, your database would store the id
So how does one protect JSP's from direct invocation? Is there a
server-independent way? (I'm using Tomcat, so that would also be good to
know.)
Maya Muchnik wrote:
Hello, Jens again,
I am totally agree with you, but to make it works somebody (a designer) must
to "protect" jsp files.
Get a copy of "Extreme Programming Explained" by Kent Beck. It's not
struts-specific at all but will show you how to proceed.
James Howe wrote:
The company I work for wants to create a web version of an existing
application. We have created a static web site which we are using as the
Glad I'm running Netscape on Linux! :^)
Administrator wrote:
Antigen for Exchange found AnnaKournikova.jpg.vbs matching =*.vbs file
filter.
The file is currently Removed. The message, "Here you have, ;o)", was
sent from David Reynolds and was discovered in IMC Queues\Inbound
located at
Hi,
Is there a tag (in struts or elsewhere) that will evaluate its body into
a String that can be squirreled away for later use?
Thanks,
John
- Original Message -
From: "John Raley" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 31, 2001 12:31 PM
Subject: ActionForward: scope of modifications?
I didn't do a thorough walk through the source, but it appears that if I
modify an ActionForwar
A redirect instructs the client to generate a new request, so by the time
foo.jsp is invoked the request containing the bean is gone.
James Howe wrote:
I have two JSP pages which I want to have share a bean. In the first JSP
page I do something like this:
[...]
jsp:useBean id="bean"
I didn't do a thorough walk through the source, but it appears that if I
modify an ActionForward returned from an ActionMapping passed to
Action.perform I am changing global state in struts. Is this correct?
If so, I think this should be in the javadoc for ActionMapping, and
ActionForward should
Right now I'm "forwarding" to a JSP that does nothing but redirects to the
URL I want them to see (basically what you said). I would love to hear
better solutions as well.
Bear wrote:
I'm just in the process of re-vamping my web app to use the Struts
framework (moving from a Model 1 to a
"Deadman, Hal" wrote:
You can specify that a forward be handled by a redirect instead of a
jsp:forward by doing this:
Ack! "You could have gone home anytime by clicking your shoes together." - to
Dorothy. Guess I should read the dtd a little more closely...
Thanks.
"Craig R. McClanahan" wrote:
there are a *substantial* number of incompatible API changes.
Is there a conversion guide out there? I poked around the site a little
and didn't see one.
Thanks,
John
Sometimes I wonder whether we should start a "Struts on WebLogic" list... :^)
Michael, I will reply privately to you with some resources for this and other
WL-related problems.
John
Michael Gerdau wrote:
Hi !
I'm a newbie to struts and thus am certainly prone to trivial mistakes. So
, and properly initialize servlets requesting to be initialized
with loadOrder in web.xml. See:
http://archive.covalent.net/jakarta/struts-user/2000/10/0009.xml
-- Erik
-Original Message-
From: John Raley [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 17, 2000 11:27 AM
I've deployed the struts examples in WebLogic 5.1.0. (If Struts is not
compatible with WL stop me here.) I'm having trouble running the
example app and the cookie test.
The example app throws the following exception:
javax.servlet.jsp.JspException: Missing resources attribute
67 matches
Mail list logo