Re: This list NEEDS a FAQ

2001-10-26 Thread steven . valin

On Fri, 26 October 2001, [EMAIL PROTECTED] wrote:

> I agree with the sentiment behind your suggestion, though. The real problem
> is that many people don't refer to the FAQ, and don't check the mailing list
> archives, before posting their own questions to the list. Unfortunately,
> these are typically the same people who believe that their own time is more
> valuable than that of other people on the list.

I'll second that.  Many many questions have been posted on this list that are clearly 
explained in the documentation.

The documentation isn't perfect, and can be confusing at times, but some due diligence 
should be expected.  Not only is there documentation, but the source code is available 
and it will tell you the truth like no other!

About a month ago I was thrilled to see someone respond to a question with "RTFM"!

--
Steven Valin
[EMAIL PROTECTED]



Re: Problem populating form bean with multiple parameters of same name

2001-10-21 Thread Steven Valin

Renaud,

I appreciate your response, but unfortunately when the JSP is regenerated and
displayed, Struts places the toString() value of the String array into the
 tags, such as:

[Ljava.lang.String;@262bf4

I have also tried a twist on this strategy, with:

private String propertyName[];
private int propertyNameIndex;

public void setPropertyName(String[] propertyName) {
this.propertyName = propertyName;
propertyNameIndex = 0;
   }

public String getPropertyName() {  // send default value if index out of
range
return ((propertyNameIndex < propertyName.length) ?
propertyName[propertyNameIndex++] : "");
}

I was hoping that this strategy would allow the JSP to populate each  field with successive calls to getPropertyName() but this then results in:

javax.servlet.jsp.JspException: Exception thrown by getter for property fileName
of bean org.apache.struts.taglib.html.BEAN
 at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:513)


If anybody has any other ideas on how Struts can read multiple text input
fields, all with the same name (akin to ServletRequest.getParameterValues(String
s) ), and properly populate those same fields when the JSP is displayed again, I
would greatly appreciate your thoughts!

TIA, Steve


Renaud Waldura wrote:

> Have you tried declaring your property as an array of strings?
>
> private String propertyName[];
> public String[] getPropertyName() { ... }
> public void setPropertyName(String[] propertyName) { ... }
>
> It may just work. In general I've found Struts to be amazingly flexible with
> properties and their types. Kudos to the Struts developers!
>
> --Renaud
>

--
Steven Valin
[EMAIL PROTECTED]





Problem populating form bean with multiple parameters of same name

2001-10-20 Thread Steven Valin

Does anybody know how Struts be made to populate an ActionForm bean with
a variable number of text input fields that all have the same name?

For instance, there may be 0, 1, 5, 10, or any other number of
 tags in an .

I want Struts to populate the ActionForm bean with all of the
"propertyName" values, either one at a time via multiple calls to the
ActionForm's setPropertyName(String propertyName) method, or all at once
in an array (or other data structure) much like would be accomplished
with the ServletRequest.getParameterValues("propertyName") method.

I have tried to accomplish this any number of ways but have been
unsuccessful and haven't seen anything in the documentation explaining
how this should be done.

TIA, Steve

--
Steven Valin
[EMAIL PROTECTED]





Re: Validation Framework: validating field length

2001-10-04 Thread steven . valin

Read under "Numeric quantifiers"

http://gnosis.cx/publish/programming/regular_expressions.html

On Thu, 04 October 2001, Matt Raible wrote:

> 
> In response to:
> 
> http://www.mail-archive.com/struts-user@jakarta.apache.org/msg15960.html
> 
> Dave - what regular expression would I use to say "any characters, just less
> than 1000 characters"?
> 
> Thanks,
> 
> Matt
> 
> __
> Do You Yahoo!?
> NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
> http://geocities.yahoo.com/ps/info1

--
Steven Valin
[EMAIL PROTECTED]



Re: Problem with weblogic

2001-10-04 Thread Steven Valin

Or put the struts.jar in the WEB-INF/lib directory of your war file.

Jonathan M Crater wrote:

> sounds like a classpath issue to me.  make sure your struts.jar is in your
> weblogic classpath when the server is started.
>
> ALAMI Ahmed - BOR wrote:
>
> > Hello everyone
> >
> > Does anyone knows the steps to deploy a WAR application using struts under
> > Weblogic please
> > When compiling to create the web.xml and weblogic.xml, it returns an error
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > org/apache/struts/action/Act
> > ion
> >
> > Help me please
> >
> > Ahmed ALAMI
> > Stagiaire
> >
> >
> > 8, rue Gustave Hertz - 33600 Pessac
> > * 05.57.89.00.36 *06.17.23.26.61 * 05.56.36.64.71
> > * [EMAIL PROTECTED]
> >
> > -Message d'origine-
> > De : Bang, Steinar [mailto:[EMAIL PROTECTED]]
> > Envoyé : jeudi 4 octobre 2001 10:47
> > À : '[EMAIL PROTECTED]'
> > Objet : struts-example.war from struts 1.0, and missing .do servlets
> > (and how to get web.xml)
> >
> > Platform: debian woody, apache 1.3.19, tomcat 3.2.3,
> >   struts 1.0, Java2 SDK 1.3
> >
> > [I'm not on the mailing list, so please Cc me on any
> >  response.  Thanx!]
> >
> > I've downloaded the binary distribution of struts 1.0
> > from
> > <http://jakarta.apache.org/builds/jakarta-struts/release/v1.0/>
> >
> > And followed a modified version of what the INSTALL
> > file says about installation under Tomcat:
> >  - I've copied "struts-documentation.war" and
> >"struts-example.war" to /usr/share/java/webapps/
> >  - I've added "DirectoryIndex index.jsp index.html" and
> >"AddHandler jserv-servlet .do" to /etc/apache/srm.conf
> >  - I've restarted tomcat and then restarted apache
> >
> > The <http://localhost/struts-documentation> URL seems to
> > work fine, but <http://localhost/struts-example> has
> > some problems:
> >  - how do I get the web.xml file from struts-example?
> >(the tutorial says to look at it to see how you
> > should create a web.xml file for your own application)
> >If I remove the DirectoryIndex mapping for index.jsp,
> >I get to list the directory for struts-example, but
> >I'm not allowed to access <http://localhost/struts-example/WEB-INF/>
> >where I presume the web.xml file can be found?
> >
> >  - the other problem is related to actually running
> >the application.  If I try clicking on the link
> >"Register with the MailReader Demonstration Application",
> >I get a 404 not found on the URL
> > /struts-example/editRegistration.do;jsessionid=83vbrf4511
> >The "Walking tour of the Example Application", gives
> >me a 404 Not found, on the URL
> > /struts-example/tour.do;jsessionid=84vbfr4511
> >The "Log on to the MailReader Demonstation Application"
> >pops up a form requesting username and password,
> >but I don't have anything meaningful to give it,
> >so I can't test if it actually works.
> >Both the "problem" links are .do files.  When
> >I remove the index.jsp DirectoryIndex mapping
> >I can't find any .do files on the top level.
> >Presumably they reside under WEB-INF/ somewhere,
> >but since I can't access that directory from the
> >web browser, I can't check.
> >I'm guessing that I'm missing some configuration
> >on .do files, but I don't know what.
> >
> > I'm continuing to dig at the problems, but all
> > hints and tips will be appreciated.
> >
> > Thanx!
> >
> > - Steinar
> >
> >
> > This email, its content and any attachments is PRIVATE AND CONFIDENTIAL to
> > TANDBERG Television. If received in error please notify the sender and
> > destroy the original message and attachments.

--
Steven Valin
[EMAIL PROTECTED]





Re: security question

2001-10-01 Thread Steven Valin

Interesting.  A reply from their tech support indicates that WebLogic 6 still
does not permit this, as do my own tests.

"Khorramrouz, Turaj" wrote:

> Hi Jonathan,
> you don't have the problem with "RequestDispatching to JSPs underneath
> WEB-INF"  in weblogic 5.1 with sp 10 any more.
>
> regards,
>
> Turaj
>
>
> -Original Message-
> From: Jonathan M Crater [mailto:[EMAIL PROTECTED]]
> Sent: Montag, 24. September 2001 17:49
> To: [EMAIL PROTECTED]
> Subject: security question
>
> i'm using weblogic 5.1, which does not allow RequestDispatching to JSPs
> underneath WEB-INF.  so i'm stuck keeping my JSPs outside WEB-INF.  as a
> result,
> i have to secure requests to both JSPs and actions.  securing the actions is
> just a matter of sub-classing ActionServlet and providing logic to check for
> certain secured paths.  the problem is i don't want to repeat the logic in
> the JSPs--either through a tag library or otherwise.  does anyone have any
> suggestions as to how best to prevent a situation where a user requests a
> JSP page directly when it should have gone through the sub-classed
> ActionServlet?  i was thinking of just setting a request parameter for each
> request as it passes through the ActionServlet.  that way, in the JSP i can
> just test for that value to determine whether the request went through the
> proper channel.  if not, i can redirect to an error page.
>
> thoughts?  suggestions?

--
Steven Valin
[EMAIL PROTECTED]





Re: multi form pages

2001-09-26 Thread steven . valin

What you are asking is really an HTML question.  I don't believe you will have any 
problem with multiple forms on a single page.  However, I do believe that only the 
parameters of the submitted form will be sent to the server.

I've never tried this and am willing to be corrected by anyone who knows for certain!

On Wed, 26 September 2001, "Hogan, John" wrote:

> 
> 
> 
> 
> 
> 
> 
> 
>  class=636530314-26092001>There's been quite a bit of discussion on the list 
> about multi-page forms, but nothing on multi-form 
> pages.
>  
> D class=636530314-26092001>oes anyone know if a single jsp class=636530314-26092001> can contain more than one form 
> section that reference different 
> ActionForm objects?  
> TIA.
>   face=Arial>
> JohnH
>  class=636530314-26092001> 
>  class=636530314-26092001> 

--
Steven Valin
[EMAIL PROTECTED]



Re: JSP is not creating and/or populating an action form?

2001-09-25 Thread steven . valin

Have you ensured that your struts-config.xml is written correctly, in particular the 
 tag parameter and the associated  tag?

On Tue, 25 September 2001, "Peter Pilgrim" wrote:

> 
> JSP is not creating and/or populating an action form?
> 
> I can associate the  with the action form.
> I can see the bean created by the time the JSP is generated.
> However when I  the form the action.perform()
> method has a "form" parameter that equals null.
> I look at the struts-config.xml and it looks correct to me.
> How do a find out what the bug is ?  Any tips, hints?
> 
> Ta very much
> --
> Peter Pilgrim  |  |++44 (0)207-545-9923
>  \  \  ___   /  / ... .
> -     ( * )  ---   --
> _Cafe_Savannah,_San Antonio,Ibiza__
> 
> 
> 
> --
> 
> This e-mail may contain confidential and/or privileged information. If you are not 
>the intended recipient (or have received this e-mail in error) please notify the 
>sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
>distribution of the material in this e-mail is strictly forbidden.

--
Steven Valin
[EMAIL PROTECTED]



Re: security question

2001-09-24 Thread steven . valin

Can anybody tell me if this issue of RequestDispatching to JSPs under WebLogic 5.1 
also exists for WebLogic 6.0+?

On Mon, 24 September 2001, Ted Husted wrote:

> 
> If all the JSP's are behind Actions, the problem is mitigated since the
> names of the JSPs are not revealed on the address bar, only the Action
> shows. 
> 
> One idea would be to generate a request token for each request that
> comes through the Action. That could be a dual use features, since you
> could use the same token to watch for duplicate submits. You might also
> put "expects" check at the top of the JSPs that use any other attribute
> in the request, and redirect them to the Action when the attribute is
> missing. That documents what the JSP requires, and provides QA on top of
> security.
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel +1 716 737-3463
> -- http://www.husted.com/about/struts/
> 
> 
> Jonathan M Crater wrote:
> > 
> > i'm using weblogic 5.1, which does not allow RequestDispatching to JSPs underneath 
>WEB-INF.  so i'm stuck keeping my JSPs outside WEB-INF.  as a result,
> > i have to secure requests to both JSPs and actions.  securing the actions is just 
>a matter of sub-classing ActionServlet and providing logic to check for
> > certain secured paths.  the problem is i don't want to repeat the logic in the 
>JSPs--either through a tag library or otherwise.  does anyone have any
> > suggestions as to how best to prevent a situation where a user requests a JSP page 
>directly when it should have gone through the sub-classed
> > ActionServlet?  i was thinking of just setting a request parameter for each 
>request as it passes through the ActionServlet.  that way, in the JSP i can
> > just test for that value to determine whether the request went through the proper 
>channel.  if not, i can redirect to an error page.
> > 
> > thoughts?  suggestions?

--
Steven Valin
[EMAIL PROTECTED]



RE: Navigation history

2001-09-21 Thread steven . valin

If your current pageN values map directly to JSPs, and you want the navigation through 
those particular JSPs to be contained in the bread crumb stack, then I believe you 
would need to map the pageN values to Actions that would handle the appropriate bread 
crumb logic.

On Fri, 21 September 2001, "Thinh Doan" wrote:

> 
> Thanks Steven.  Your suggestion sounds pretty elegant.  I now have a follow
> up question.
> On my pages, I use a lot of  where pageN is
> defined in the .  Does that mean I now have to make all of
> these into an action and then have an action class for each link?
> 
> Appreciate your help.
> 
> Thinh
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 20, 2001 12:48 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Navigation history
> 
> 
> One implementation has been to subclass the Action object with another
> object (named something like OurGeneralAction).  All of your other Action
> objects, such as LogonAction, LogoffAction, DoSomethingAction then subclass
> OurGeneralAction.
> 
> Just prior to returning an ActionForward from your specific Actions (Logon,
> Logoff, etc.) you call a doBreadCrumb(String actionFwdName, HttpSession
> session) method that is contained in OurGeneralAction.
> 
> doBreadCrumb() looks in the session object for another class (perhaps called
> BreadCrumbs) that push or pop the actionFwdName from a stack.
> 
> That stack can then be used from a JSP using logic:iterate and bean:write to
> display the list of "bread crumbs".
> 
> There are a variety of details and complexities that are left out of this
> description, such as how you determine whether to push to, or pop from the
> stack, the exact text to display for each bread crumb, etc.  However, the
> general idea is represented.
> 
> On Thu, 20 September 2001, "Thinh Doan" wrote:
> 
> >
> > Would you please give me some ideas on how to implement a bread crumb
> scheme
> > to keep track of where the user has been navigated around the application?
> > Each menu has been implemented with a html:link with a forward name in the
> > global-forwards definitions in struts-config.xml.
> >
> > I'm planning to have a designate area on the template for this.  It'd nice
> > to retrieve the navigation history w/o resorting to scriptlets.
> >
> > Thank you very much for your suggestions.
> >
> > Thinh
> 
> --
> Steven Valin
> [EMAIL PROTECTED]

--
Steven Valin
[EMAIL PROTECTED]



Re: Implementation of Synchronizer Token

2001-09-20 Thread steven . valin

Many thanks Ted for a point in the right direction.  I'll let you know what I come up 
with.

Steve

On Thu, 20 September 2001, Ted Husted wrote:

> 
> It's not mentioned in the UserGuide, which is an oversight. It is used
> in the Examples application. The implementation is part of the Action. 
> 
> http://jakarta.apache.org/struts/api/org/apache/struts/action/Action.html
> 
> If you find a good place to insert coverage in the Users Guide, don't
> hesitate to provide a "patch" that we could plug into the documentation
> ;-)
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel +1 716 737-3463
> -- http://www.husted.com/about/struts/
> 
> 
> [EMAIL PROTECTED] wrote:
> > 
> > The Struts documentation doesn't seem to indicate that Struts provides an 
>implementation of the Synchronizer Token described on p.77 of Core J2EE Patterns.
> > 
> > Can somebody tell me if I have overlooked something in the documentation?
> > 
> > If I haven't, does anybody have any suggestions for a custom Synchronizer Token 
>implementation for use within a Struts-based web app?
> > 
> > TIA, Steve
> > 
> > --
> > Steven Valin
> > [EMAIL PROTECTED]

--
Steven Valin
[EMAIL PROTECTED]



Implementation of Synchronizer Token

2001-09-20 Thread steven . valin

The Struts documentation doesn't seem to indicate that Struts provides an 
implementation of the Synchronizer Token described on p.77 of Core J2EE Patterns.

Can somebody tell me if I have overlooked something in the documentation?

If I haven't, does anybody have any suggestions for a custom Synchronizer Token 
implementation for use within a Struts-based web app?

TIA, Steve

--
Steven Valin
[EMAIL PROTECTED]



Re: ActionMessages throwing NullPointer and message is in properties??

2001-09-20 Thread steven . valin

First idea...
   ensure that neither messages nor aTimesheetDO is null

On Thu, 20 September 2001, Matt Raible wrote:

> 
> I am getting a NullPointerException on the following code:
> 
> messages.add(new ActionMessage("timesheetManage.reset.success",
> aTimesheetDO.getEmployeeName()));
> 
> And in my ApplicationResources.properties file, I have the following entry:
> 
> timesheetManage.reset.success=Timesheet for \"{0}\" re-generated successfully
> from holidays and work profile (if applicable).
> 
> Any ideas?
> 
> Thanks,
> 
> Matt
> 
> __
> Terrorist Attacks on U.S. - How can you help?
> Donate cash, emergency relief information
> http://dailynews.yahoo.com/fc/US/Emergency_Information/

--
Steven Valin
[EMAIL PROTECTED]



Re: Navigation history

2001-09-20 Thread steven . valin

One implementation has been to subclass the Action object with another object (named 
something like OurGeneralAction).  All of your other Action objects, such as 
LogonAction, LogoffAction, DoSomethingAction then subclass OurGeneralAction.

Just prior to returning an ActionForward from your specific Actions (Logon, Logoff, 
etc.) you call a doBreadCrumb(String actionFwdName, HttpSession session) method that 
is contained in OurGeneralAction.

doBreadCrumb() looks in the session object for another class (perhaps called 
BreadCrumbs) that push or pop the actionFwdName from a stack.

That stack can then be used from a JSP using logic:iterate and bean:write to display 
the list of "bread crumbs".

There are a variety of details and complexities that are left out of this description, 
such as how you determine whether to push to, or pop from the stack, the exact text to 
display for each bread crumb, etc.  However, the general idea is represented.

On Thu, 20 September 2001, "Thinh Doan" wrote:

> 
> Would you please give me some ideas on how to implement a bread crumb scheme
> to keep track of where the user has been navigated around the application?
> Each menu has been implemented with a html:link with a forward name in the
> global-forwards definitions in struts-config.xml.
> 
> I'm planning to have a designate area on the template for this.  It'd nice
> to retrieve the navigation history w/o resorting to scriptlets.
> 
> Thank you very much for your suggestions.
> 
> Thinh

--
Steven Valin
[EMAIL PROTECTED]



Another Struts Console feature request

2001-09-13 Thread steven . valin

I would also like to see a New item on the File menu!

--
Steven Valin
[EMAIL PROTECTED]



Re: [ANNOUNCE] Struts Console

2001-09-13 Thread steven . valin

I concur that this is off to a nice start and should be useful to many people.

If you want to tailor the EOL for the particular platform (you may already know this) 
you can append System.getProperties().getProperty("line.separator") to the end of each 
line instead of hardcoding '\n' or "\r\n".

On Thu, 13 September 2001, Bill Clinton wrote:

> 
> Hello,
>  It ran fine under Redhat 7.1, other than a bunch of missing font 
> messages.  I personally did not like the way it reformatted my entire 
> struts-config.  Could this be because it is not interpreting unix text 
> file format correctly, or does it do this on windows too?  Also, it put 
> a bunch of ^Ms in my file which is an annoying, but somewhat common 
> occurance when viewing dos/windoze text files in unix.
>  I personally would not have any need for a program like this.  I am 
> more comfortable editing a well commented xml file.  But everbody is 
> different and many people might find this very useful.  It looks like 
> you have done a very nice job so far - keep up the good work!
> 
> Bill
> 
> James Holmes wrote:
> 
> >I have put together a GUI for Struts called Struts
> >Console.  Struts Console is a Java Swing based
> >application for managing Struts configuration files.
> >
> >Struts Console is availbale at:
> >http://www.geocities.com/jholmes612/
> >
> >Just unpack the zip file and view the README for
> >details on running Struts Console.
> >
> >I'd like to get people's feedback and find out what
> >they like/dislike, what they would add/remove or
> >anything else you think about the tool.
> >
> >I'd like to see this tool evolve into "the" struts GUI
> >app and be part of the standard struts distribution.
> >
> >Thanks,
> >
> >James Holmes
> >[EMAIL PROTECTED]
> >
> >__
> >Do You Yahoo!?
> >Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
> >http://im.yahoo.com
> >
> >.
> >

--
Steven Valin
[EMAIL PROTECTED]