Re: forwarding to specific browser window??

2002-09-04 Thread John Raley
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

Re: getting data in value object out of logic:iterate

2002-09-04 Thread John Raley
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

[ANN] Map - JavaBean API, arbitrary property names! dynclass.sourceforge.net

2002-09-04 Thread John Raley
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

Re: ArrayIndexOutOfBoundsException while using logic:iterate

2002-09-02 Thread John Raley
. -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

Re: ArrayIndexOutOfBoundsException while using logic:iterate

2002-09-01 Thread John Raley
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

Re: Composite jsp files

2002-08-28 Thread John Raley
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

Re: Want to Access Key/Value Pairs in Hashtable within jsp

2002-08-28 Thread John Raley
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

Re: iterate tag help.

2002-08-28 Thread John Raley
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'/

Re: problem with PropertyUtils.getProperty()

2002-08-27 Thread John Raley
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 -

Re: form validate: when using System.out.println() ,there is informationprint

2002-08-27 Thread John Raley
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

Map - JavaBean API available @ dynclass.sourceforge.net

2002-08-27 Thread John Raley
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() {

Re: Please - a little help with NoSuchMethodError with Tomcat, Stru ts and Apache

2001-10-02 Thread John Raley
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

Re: how to capture html

2001-09-24 Thread John Raley
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

Re: Nesting Tags (Again)

2001-09-07 Thread John Raley
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

Re: Line of Code Counter?

2001-09-06 Thread John Raley
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

Re: Quick question (nesting tags)

2001-09-05 Thread John Raley
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

Re: tags build upon tags

2001-08-28 Thread John Raley
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

Re: nesting bean:write inside of html:link

2001-08-27 Thread John Raley
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 /

Re: nesting bean:write inside of html:link

2001-08-27 Thread John Raley
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

Re: Question about the use of enumerated types in struts

2001-08-27 Thread John Raley
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,

Re: nesting bean:write inside of html:link

2001-08-27 Thread John Raley
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

Re: welcome file in web.xml with pre-compiled jsp's?

2001-08-24 Thread John Raley
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

Re: tags build upon tags

2001-08-24 Thread John Raley
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

Re: welcome file in web.xml with pre-compiled jsp's?

2001-08-23 Thread John Raley
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

Re: [Q] ActionServlet Forwarding

2001-08-21 Thread John Raley
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

Re: WARN: email hoax

2001-08-20 Thread John Raley
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.

Re: Speed issues w/ Strut Tag Library

2001-08-17 Thread John Raley
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

Re: Page-by-Page Iterator Pattern

2001-08-13 Thread John Raley
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

Re: iterate vector of vectors

2001-06-28 Thread John Raley
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.

Re: Getting values from ActionForm bean

2001-06-06 Thread John Raley
(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

Re: Problem with nested html:form

2001-06-06 Thread John Raley
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

Re: throwing Exceptions from perform()

2001-06-05 Thread John Raley
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

Using tags from Java code

2001-05-24 Thread John Raley
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

Re: Using tags from Java code

2001-05-24 Thread John Raley
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

Re: Disable JSP ?

2001-05-17 Thread John Raley
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

Re: ActionForm.reset() not called when form tag creates bean

2001-05-10 Thread John Raley
- 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

Re: how to forward from one action servlet to another?

2001-05-10 Thread John Raley
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

ActionForm.reset() not called when form tag creates bean

2001-05-09 Thread John Raley
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

Does forwarding remove request parameters?

2001-05-09 Thread John Raley
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

Re: Does forwarding remove request parameters?

2001-05-09 Thread John Raley
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

Re: Servlets, Beans, Struts, and Threading

2001-05-04 Thread John Raley
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

Re: Servlets, Beans, Struts, and Threading

2001-05-03 Thread John Raley
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

Re: Casting beans in JSP

2001-04-20 Thread John Raley
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

Re: Checking User log in in a JSP page

2001-04-19 Thread John Raley
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

Re: handling the errors

2001-04-12 Thread John Raley
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

Re: handling the errors

2001-04-12 Thread John Raley
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

GUI classes, and a config file problem

2001-04-11 Thread John Raley
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

Re: GUI classes, and a config file problem

2001-04-11 Thread John Raley
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

Re: Basic design questions

2001-04-02 Thread John Raley
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

Re: logic:equal and nesting

2001-03-15 Thread John Raley
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

Re: Another newbie question

2001-03-15 Thread John Raley
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 \

Re: ActionForm question (repost)

2001-03-08 Thread John Raley
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

Re: Date fields

2001-03-02 Thread John Raley
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

Re: double submission of forms

2001-03-02 Thread John Raley
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

Re: Why should you call JSP pages directly?

2001-03-01 Thread John Raley
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.

Re: Tips needed

2001-02-28 Thread John Raley
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

Re: Antigen found =*.vbs file

2001-02-12 Thread John Raley
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

Eval tag?

2001-02-12 Thread John Raley
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

Re: ActionForward: scope of modifications?

2001-02-05 Thread John Raley
- 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

Re: Is request shared across a redirect?

2001-01-31 Thread John Raley
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"

ActionForward: scope of modifications?

2001-01-31 Thread John Raley
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

Re: Post/re-post problems

2001-01-24 Thread John Raley
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

Re: Post/re-post problems

2001-01-24 Thread John Raley
"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.

Re: Missing Something

2001-01-23 Thread John Raley
"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

Re: Struts with weblogic. Anyone ?

2000-11-23 Thread John Raley
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

Re: Update on example app failure in WebLogic 5.1

2000-11-19 Thread John Raley
, 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

Problems with example app, and cookie match tests, in WebLogic 5.1

2000-11-15 Thread John Raley
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