Re: Action Form Design Question

2003-09-19 Thread K.C. Baltz
Personally, I've tried to stay away from putting data in the ActionForm 
that isn't related to an actual form submission value.  So if I have a 
drop down with a list of countries for the user to choose, the list of 
countries goes into the request attributes and the single choosen 
country value goes into the ActionForm.  That way, you don't need to 
repopulate the Country List when the user submits their form, something 
you might have to do if you put the list into the ActionForm. 

This is just what has worked for me.  I've definitely struggled with 
where to put data and I'm going to be curious to see other replies to 
your question.

K.C. 

Michael Thompson wrote:

I've hit a stumbling block and I'm not quite sure how to work around 
it.  I've written struts apps in the past and I've taken the approach 
of putting everything in the ActionForm so that the jsp has a one stop 
shop for all it's display needs.  So where I've hit an issue is when 
say I have jsp A that is rendered with form A.  When user submits data 
to action A, the ActionForm pushed to execute is form A.  What happens 
when I need to forward from action A to jsp B which is rendered with 
form B?  I need to populate an ActionForm B to send to jsp B, but I 
don't have one.  Is it "normal" to create a form of a different type 
in your Action?  So essentially the code would look something like:

public ActionForward execute(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
  FormA inputForm = (FormA)form;
  Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm);
FormB outputForm = getInstanceOfFormB(mapping, request);  //this 
would stash in request/session also
  populateFormBWithResults(outputForm, result);

  return mapping.findForward("success");
}
getInstanceOfFormB is a little hazy, but I did notice a method in 
RequestUtils that might help.  Seems like this might be breaking some 
struts abstractions by knowing what form to create etc.

Is this the correct way to approach this or should I think about a 
redesign of my forms and actions?  Thanks in advance!
--m



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: One form, multiple JSPs, multiple validations

2003-09-15 Thread K.C. Baltz
What you're looking for is a way to validate a form with multiple 
"pages".  Read this, paying special attention to "Multi Page Forms"  
http://jakarta.apache.org/struts/userGuide/dev_validator.html

K.C.

Ruben Carvalho wrote:

Good afternoon helpers,

I've started a new application using struts 1.1 and I'm having some problems with some new concepts.

I want to use XML form validation (DynaValidatorForm) using validator-rules.xml and my validaton.xml. Right now my application is working fine. Now I want to use different validation rules for the same form, accross multiple JSPs. For example:

- TestForm is a DynaValidatorForm
 String name
 String address
- test1.jsp
 I want to show one text box to fill the "name" property:
(...)
 
(...)
- test2.jsp
 I want to show one text box to fill the "address" property:
(...)
 
(...)
- struts-config.xml
(...)

   
 
 
   

(...)
- validaton.xml
(...)
   
   
   
   
   
   
   
   
   

(...)
Now, I run http://localhost/app/test1.jsp and I fill in my "name" property. Then I want my app to validate only the "name" property. Then I forward to test2.jsp, fill the "address" property and now I want to validate only the "address" property. How can I do this? The problem is, what identifies a rule in validation.xml is the form name. I could define different names for my form in the struts-config.xml but imagine if I had 10 JSPs for each form.

Thanks in advance

Rúben Carvalho





 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Converting a ResultSet to a List of POJOs

2003-09-08 Thread K.C. Baltz
Since I had to look it up, maybe others did too:

POJO = Plain Old Java Object.

I'm guessing that means a Java object that doesn't need to know how it 
is persisted in order to be stored?  I.e., in Matt's case, the object 
isn't modified to take ResultSet as an argument to the constructor. 

K.C.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Validator framework and DispatchAction

2003-08-28 Thread K.C. Baltz
You're going to have to provide us the stack trace so we can tell with 
method is not being found. 

K.C.

Venkat Jambulingam wrote:

Hi there,

I extended my Action classes with DispatchAction class and it works
just fine. Now I am trying to use validator framework in my app.
JavaScript validation is working fine. But server-side validation is
giving "NoSuchMethodFound" error. I searched the archive but could not
find any solution. I saw some discussions on 
ValidatorLookupDispatchAction class. I am not sure whether it is ready
for "production" use. Can anyone please suggest some solution? 

Thanks,
Venkat
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: EL version of tag libraries

2003-08-26 Thread K.C. Baltz
It comes with struts.  Look in the contrib directory.  Also, the Struts 
homepage has information about it.  Google is your friend.

K.C.

Jiří Mareš wrote:

Where can I get html-el? (if el means expression language).

Thanks a lot

Slattery, Tim - BLS wrote:

 > Why is it that the html-el:hidden tag has no "styleId" attribute?


I'll go with the logical answer of:


 

It's a hidden form tag, so there is no point
in having a visual style for a non-visible element.


 

Regards,
David


"styleId" becomes the "id" attribute of the HTML tag. That is *not* a 
visual
style. It makes it possible to address the element and retrieve or 
assign a
value in Javascript. The regular  tag has styleId, so 
why in
the world did the implementors drop it from the  
tag?

--
Tim Slattery
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Struts Validator mask

2003-08-22 Thread K.C. Baltz
I'm not familiar with the use of double quotes in regexes.  However, you 
seem to have the right idea.  Instead of quotes, try using \\ in place 
of each \ you want to match.  E.g.:

^\\(\\[A-Za-z0-0_-]+)+\\?$

Quick explanation

\\ - Must start with a single backslash

(\\[A-Za-z0-0_-]+)  - A pattern representing a backslash followed by one 
or more valid letters/numbers/symbols.  If - is the last character in a 
[ ] block, it loses its special meaning and just matches -. 



The pattern is wrapped in () and specified to occur 1 or more times with 
+. 

Finally, there's a trailing \\? saying the path may optionally end with 
\.  Don't know if you want that or not.

NOTE: this pattern won't allow "\\".  Don't know if that matters.

K.C.

Daniel Massie wrote:

I am trying to write a regular expression to represent a network path.
Network paths are of the form
\\path\to\folder
The regular expression which I thought would achieve this is
^"\"{2}([A-Za-z0-9]"-_")+"\"{1}([A-Za-z0-9]"-_\")+$
But I am having no luck. Can anyone help?
Thanks

Daniel Massie

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Setting a Welcome File + Tiles + PreCompiled JSP's

2003-08-21 Thread K.C. Baltz
I just have an index.jsp that I still include in the war, even though 
all my JSPs are pre-compiled.  I'm not actually sure if the file version 
or the pre-compiled version gets called.  Doesn't really matter I 
guess.And I use a META refresh to redirect to my main page:

">

K.C.

Pat Quinn wrote:

I'm using tiles and i know i can't set the  attribute in 
web.xml to a tile definition or a struts action url. I'm also 
precompiling all my JSP's so i can't assign it to a JSP... i was 
thinking about assign it to a html file and then onLoad i could 
redirect to my logon action url... to do this i'd have to hard code 
the ipaddress and port number into my url so i don't really want to do 
that. Any ideas how i might do this?

_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: From prepopulation, validation and reset

2003-08-15 Thread K.C. Baltz
I'd like an answer to this one too.  (It's fortuitous--I just ran into 
this problem today)

K.C.

Craig Margenau wrote:

The prepopulation of form offered through ActionForms and the html:form tag is great, the only problem is that when the validate method returns errors, and your input page is called again, the reset() method is called thus nullifying any user inputed values.  So if a user screws up 1 field on a 20 field form, when the errors are displayed it wipes out the rest of the form.

Sure there are ways around this, I use an html:hidden attribute (as someone else suggested) to pass a "noreset" param, then check that in the ActionForm's reset function.  This works well but is kinda a kludge.

I also understand that you can extend ActionConfig or RequestProcessor to handle this, but again that's more complex than most would like.

The author has mentioned that adding a "reset=true/false" in the Action section of struts-config was purposely not implemented, and I can kinda understand that too, but how about a validate-error-reset="true/false" property so that you can disable the reset function only if a validation error occurs?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Will Pop-Up Window Share The Same Session?

2003-08-15 Thread K.C. Baltz
Glad we could help :)

Hohlen, John C wrote:

I've answered my own questions:
1) Yes - It will share the session.
2) The reason I was getting a blank screen was due to some missing "<" and ">" in the 
struts config.  Doohhh!!  It should have been:

  type="com.erac.edge.presentation.customer.pricingplan.PopUpTestAction">   
 
  path="/jsp/popUpWindowTest.jsp"/>
  

-Original Message-
From: Hohlen, John C 
Sent: Friday, August 15, 2003 10:10 AM
To: Struts-User (E-mail)
Subject: Will Pop-Up Window Share The Same Session?

I'm trying to launch a pop-up window for displaying read only data from my main application window.  I'm currently having a problem getting the new pop-up window to display anything.  It's just blank, so I'm unable to answer the subject question.  Here is how I'm launching the new window using the Struts  tag:

 
  
The URL for where to go is currently stored in request scope under the key: com.erac.edge.presentation.common.popUpWindowUrl The value of the key contains an action mapping path defined in my Struts config which ultimately forwards to a JSP: forward name="next" path="/jsp/common/Success.jsp"> My action is definitely getting called, and it looks up the the mapping for "next", but I never reach my JSP. In summary, my two questions are: 1) Will the session be shared by the new window? 2) Why am I seeing a blank screen instead of my JSP? Thanks, JOHN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

How to automatically trim Strings from forms?

2003-08-14 Thread K.C. Baltz
How do you handle trimming the Strings entered in a form?  With a 
regular ActionForm, I supposed you could do the trimming in the setter, 
although you'd have to do it for every property that needed to be 
trimmed.  And what about DynaForms where there is no setter?  I had the 
crazy idea of implementing a custom Validator that would trim strings 
instead of reporting an error, but that's kind of outside the intent of 
Validator.

K.C.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Struts Wiki

2003-08-14 Thread K.C. Baltz
Yes, but it doesn't have the Struts documention in it, where it could be 
annotated via the Wiki mechnisms.  I think this is an excellent idea.  
I'm not very familiar with Wiki, so I don't know how hard it would be to 
copy all that documentation, but I think it would be worth it. 

K.C.

Adam Hardy wrote:

A struts-wiki already exists! Check the resources page of the struts 
website for the link.



Sydenham, Nick wrote:

As has been pointed out by several people the Struts documentation is 
rather
poor in terms of how to apply it. The books on the subject tend to be 
very
specific and don't really address real-world issues.

My suggestion is that the existing Stuts documentation is converted 
into a
wiki that everyone can use and update as they find answers. Example:
http://twiki.org/

Is this a good idea?

 

" This message contains information that may be privileged or 
confidential and is the property of the Cap Gemini Ernst & Young 
Group. It is intended only for the person to whom it is addressed. If 
you are not the intended recipient, you are not authorized to read, 
print, retain, copy, disseminate, distribute, or use this message or 
any part thereof. If you receive this message in error, please notify 
the sender immediately and delete all copies of this message ".
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Netscape vs. IE link problem

2003-08-14 Thread K.C. Baltz
Are you using an  tag in your header?  That may help with 
relative references.

K.C.

[EMAIL PROTECTED] wrote:

Hi,

In one of our Struts applications, we have created tile definitions for every page and action-mappings that link to and from these definitions instead of the JSPs themselves. The rationale for this approach is to make it easy to replicate a site using the same, or mostly the same, pages. But an interesting snafu employing Netscape (as opposed to IE) has arisen with this schema: you can evoke the appropriate forward from both browsers when submitting a form, yet if you attempt to link to the same page via an href, IE finds its way to the correct page but Netscape apparently searches for the forward in the same directory as the calling page (paying no attention to the action-mapping). I was wondering if anyone had encountered this problem and knew of a work-around.

Thanks



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Relay Actions

2003-08-14 Thread K.C. Baltz
I don't believe that's true.  When a form is needed, a check is made to 
see if it already exists in the given scope and then the bean is reused. 

K.C.

Erez Efrati wrote:

Is this true that when you relay actions, meaning have one action
forward to another action, the form gets populated twice, and moreover
needs to be specified in both action mappings, (both the RelayAction and
the RealAction )?
Erez



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tiles-EL ???

2003-08-11 Thread K.C. Baltz
Wouldn't that be beanScope="page" for his example?  Or are you assuming 
that config was already in request scope before the ?

K.C.

Yann Lebreton wrote:

maybe something like:

-Original Message-
From: Jeff Caddel [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 1:14 PM
To: Struts Users Mailing List
Subject: Tiles-EL ???
Anyone know of a non-scriplet way to do what this jsp snippet is doing?

 
 <% String editPage = (String) pageContext.getAttribute("editPage"); %>
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Struts Action in Welcome File List

2003-07-30 Thread K.C. Baltz
I believe the Servlet 2.3 spec allows for what Shane descibes (virtual 
paths for Welcome files).   Can't wait for Tomcat 5.

K.C.

Suzette Daniel wrote:

Nope this is not supported, the web.xml must map to a file.

-Original Message-
From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 30, 2003 9:51 AM
To: 'Struts Users Mailing List'
Subject: RE: Struts Action in Welcome File List





Can't you just do this:


 /PMTAction.do

I do it with JRun4.  Not sure if all containers will do an action instead of
a JSP.




-Original Message-
From: Jon Wynacht [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 30, 2003 12:41 AM
To: Struts Users Mailing List
Subject: Re: Struts Action in Welcome File List

Hmmm...tried that but still blanks out after a while...I'm wondering if 
there's an issue with my use of sessions...would that come into play 
here?

Jon

On Tuesday, July 29, 2003, at 06:56  PM, John Cavacas wrote:

 

Try,



In your index.jsp page. Also, look at sruts-blank.war example
application
for an easy to understand example of this.
John

   

-Original Message-
From: Jon Wynacht [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 29, 2003 9:41 PM
To: [EMAIL PROTECTED]
Subject: Struts Action in Welcome File List
Hi,

I've been using Struts now for some time and enjoy it immensely! 
However, I've recently run into a problem that has me perplexed. 
Usually I can figure these things out and not bother the mail lists 
but this one requires your help ;-)

I've pulled some info from the "Programming Jakarta Struts" book by 
Chuck Cavaness on how to use a Struts action in the welcome file list 
of a web.xml file.

Based on the instructions in the book I have the following welcome
file
entry in my web.xml:

 index.jsp
 
and the following code in my index.jsp:

<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>


  

  

and the following entry in my struts-config.xml file:

 

So, when I first fire up Tomcat everything forwards fine but after a 
while, if I hit the following URL:

http://localhost:8080/pmt/index.jsp

I get a blank page. No forwarding. Nothing. I've tried every combo 
possible here, including using  but eventually it 
stops forwarding.

Am I doing something subtly wrong or drastically wrong here?

Thanks in advance,

Jon

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

This communication is intended for the use of the individual(s) or
entity it
was addressed to and may contain confidential and/or privileged 
information.
If the reader of this transmission is not the intended recipient, you 
are
hereby notified that any review, dissemination, distribution or 
copying of
this communication is prohibited.  If you receive this communication in
error, please notify the sender immediately and delete this 
communication
from your system(s) to which it was sent and/or replicated to. (c) 2003
Sapiens Americas Corp.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Struts console plug-in - Bug - rewrite attribute

2003-07-30 Thread K.C. Baltz
Is it possible you're confusing rewrite with redirect?

K.C.

message message wrote:

To whom it my concern,

I was using the Struts console plug-in Eclipse with the Struts-logon 
application.

the console gives the error message

 "Invalid struts config File
   error on line 44:Attribute "rewrite" is not declared for element 
"forward".
  Validate that the file's DOCTYPE is supported by Struts Console. "

The error message referring to the line below in the struts-config.xml 
file.
 

I think the attribute rewrite  has not been implemented yet.

_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Fwd: Openings in J2EE/Struts

2003-07-30 Thread K.C. Baltz
For future reference, commercial announcement emails like this one 
should have a subject that begins with [ANN].  This allows readers to 
filter traffic that is not specifically Struts related.

K.C.

Ajay Patil wrote:

Hello,

I am forwarding information about openings in J2EE/Struts in our
company (based in Pune, India). 

Please email to Viraj ([EMAIL PROTECTED]) if interested.

Thanks,
Ajay
Dear Friends,

We are looking for Senior Software professionals with experience in
Advanced Java technology. The candidates should have atleast 3-4 years
of total IT experience out of which the recent 2 years experience should
be of working on Advanced Java.
If you know someone who is interested please send the profile to me or
ask the candidate to get in touch with me.
Its very very urgent !!

thanks and regards,
Viraj
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Indicating Required fields in JSP?

2003-07-28 Thread K.C. Baltz
Is there any way from a JSP to query the validator configuration for 
fields that are required?  I want to mark those fields with a * , as is 
very common on the web and I'd like to do it automatically, so I don't 
have to keep the JSP in sync with my validation rules.

K.C.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Struts Expandable Trees

2003-07-22 Thread K.C. Baltz
The javascript tree menu at www.softcomplex.com automaticallyremembers 
state between refreshes.

K.C.

Pat Quinn wrote:

I'm currently developing a prototype using struts tiles for my layout 
definition. I want to have a dynamic html tree (i.e. 
http://raibledesigns.com/struts-menu/dhtmlExpandable.jsp) on the left 
hand side, this menu will control the body content.

I'm trying to avoid using frames and javascript as i really like the 
clean development process i get from using tiles. My problem however 
is when i navigate down the tree and select a node (i.e. request a new 
view) my tree resort back to it initial state i.e. root node visible 
only.

I could use a frameset and refresh only the main content area but this 
means using javascript and possibly not using tiles... am i correct in 
assuming this or is there an alternative solution???

Any comments or suggestions appreciated.

_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Ant task to merge Struts config files

2003-07-21 Thread K.C. Baltz
You might try: 

http://www.oopsconsultancy.com/software/xmltask.html

It's not struts specific, but it does a nice job of merging XML files. 

K.C.

Vijay Balakrishnan wrote:

Hi,

Is there an Ant task to merge the Struts config files for various
sub-modules into 1 struts-config.xml file.
Thanks,
Vijay
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Action Under a Tile?

2003-07-18 Thread K.C. Baltz
I suspect the problem is somehow specific to your at-a-glance action.   
Is it possible that it's trying to redirect?

I know that it's possible to do:



which is basically what you're trying to do I assume.

K.C.

Aaron Longwell wrote:

I am intermediately experienced with Struts, but I hit a brick wall 
today trying to solve the following problem:

I am about 90% finished with a web app for a client. In discussions 
yesterday they decided to add an "at-a-glance" section to each page of 
the web site. You can think of this as a news feed that will sit on 
the left sidebar, it will have the same information on every page, but 
generating the information will require some business logic, and thus 
an Action.

I can easily add the layout for this into the tile that services the 
pages on the site It will be a simple collection to iterate over, 
so the JSP is simple as well.

The Complicated Part: adding a collection to the request scope for 
each of my existing actions. There are 15 actions existing.

I dreamed that it would be possible to add a tiles definition that 
included the result of an Action as opposed to a JSP (well, more 
accurately, included a JSP after being sent through an action first). 
Essentially, this means 2 actions are executed on each request the 
request's action... and the action to populate the data sidebar.

I tried to do this, by using a tag like this:

I get the following error: Exception in /common/at-a-glance.do Cannot 
forward after response has been committed

I am intermediately experienced with servlets, and I know that servlet 
includes are somewhat possible... but I'm obviously not experienced 
enough to solve this problem. Thanks for your help!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to differentiate between timed-out user and new user?

2003-07-09 Thread K.C. Baltz
This solution worked great.  Just to finish the topic, here's what I did 
based on TPP's advice:

- Created a Filter which examines the session ID of every request.  If 
the sessionID is invalid, it is compared to a Set of known SessionIDs.  
If the Set contains the ID, then the user has timedout and is redirected 
to an appropriate page.   Here are the relevant methods of the 
TimeoutFilter class:

   HashSet previousSessionIDs;

   public void init(javax.servlet.FilterConfig filterConfig)
   throws javax.servlet.ServletException
   {
 // Get the target redirect page from the web.xml config.
   timeoutPage = filterConfig.getInitParameter("timeoutPage");
   }
   public void doFilter(ServletRequest servletRequest, ServletResponse 
servletResponse,
   FilterChain filterChain) throws java.io.IOException, 
javax.servlet.ServletException
   {
   HttpServletRequest request = (HttpServletRequest)servletRequest;
   HttpServletResponse response = (HttpServletResponse)servletResponse;
  
   if( !request.isRequestedSessionIdValid() )
   {
   if( previousSessionIDs.contains( 
request.getRequestedSessionId() ) )
   {
   log.debug( "We have seen this session ID before" );
   RequestDispatcher rd = 
request.getRequestDispatcher("/timedout.jsp");
   rd.forward( request, response );
   return;
   }
   else
   {
   log.debug( "We have not seen this session ID before" );
   }
   }
  
   filterChain.doFilter(request, response);
   }

I use a SessionListener to record the SessionIDs when they are created.  
I'm not sure yet how I'm going to handle the Set filling up with 
SessionIDs.  I'll have to find some way to expire them.

K.C.

Paananen, Tero wrote:

I'm dealing with the issue of session timeout and I'm
having trouble figuring out how I can tell when a user
is making a request after their session has timed out.
I'd like to present them with a message indicating that
fact, rather than just assuming they're a new user and 
sending them on to the login page.  Is there any way to 
detect this?
   

Store the session ID the user is associated with
in the persistent user repository when the user
logs in. Clear it when the user logs out.
On every request, capture the session ID the browser
is sending you either as a cookie or a request parameter.
If the session has timed out, search the user repository
for the same session ID.
If you find one, you'll know the session has timed out
(user never logged out, so the session ID was not cleared).
If you don't find one (or there is no session ID sent
from the browser), it's a new user.
-TPP

-
This email may contain confidential and privileged material for the sole use of the 
intended recipient(s). Any review, use, retention, distribution or disclosure by 
others is strictly prohibited. If you are not the intended recipient (or authorized to 
receive for the recipient), please contact the sender by reply email and delete all 
copies of this message.  Also, email is susceptible to data corruption, interception, 
tampering, unauthorized amendment and viruses. We only send and receive emails on the 
basis that we are not liable for any such corruption, interception, tampering, 
amendment or viruses or any consequence thereof.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


How to differentiate between timed-out user and new user?

2003-07-09 Thread K.C. Baltz
I'm dealing with the issue of session timeout and I'm having trouble 
figuring out how I can tell when a user is making a request after their 
session has timed out.  I'd like to present them with a message 
indicating that fact, rather than just assuming they're a new user and 
sending them on to the login page.  Is there any way to detect this?   I 
need to be able to do it with and without cookies.   I've considered 
passing a parameter in every request that would let me detect that a 
user had been logged in at some point, but that seems like it would 
require a lot of manual intervention to insert that on every link.

K.C.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Adding id attributes to tags

2003-06-30 Thread K.C. Baltz
Did you try the styleId attribute?

K.C.

Ryan Shillington wrote:

In order to test my application with HTTPUnit, I need
to be able to identify my links.  I can't figure out a
way to put an id inside of the link when using the
 tag.
I have a hard time believing that I'm the first to us
HTTPUnit with struts :-).  I've checked the archives
and couldn't come up with anything.  Anybody?
I'm using Struts 1.1

Thanks,

Ryan


Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://uk.messenger.yahoo.com/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: site root going straight to a .do

2003-06-30 Thread K.C. Baltz
My understanding is that the webapp spec requires that files in the 
welcome-file-list be actual files, not servlets, because it has to test 
for their existence to decide which welcome file to use.  So, 
"/index.do"  won't work. 

K.C.

Affan Qureshi wrote:

Have you tried configuring the  in web.xml. I guess you
can do all this there.
Affan

"Simon Kelly" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
 

Hi all,

Sorry about the subject line, it's the best I can do in one sentance.

What I'm trying to do, is set up the wecome file, so that instead of
   

having
 

to go via a html or jsp page, I can go straight to an action class! Any
ideas?
If someone types in htt://our.site.com/ourapp then it should go straight
   

to
 

the welcome.do Action and not a html file.

I'm using struts1.1 and stxx.

Cheers

Simon

"I have often wondered how it is that every man loves himself more than
   

all
 

the rest of men, but yet sets less value on his own opinion of himself
   

than
 

on the opinion of others." -- Georg Christoph Lichtenberg

Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.
Tel: (+49)/7247 82-4042
E-mail : [EMAIL PROTECTED]
   





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: nested bean parameters

2003-06-29 Thread K.C. Baltz
Sounds like getStartingLocation is returning a null, and so  
can't call getLocationId on a  null object.

K.C.

Mick Knutson wrote:

I tried that:

But got this error:
Tag 'insert' can't insert page '/WEB-INF/default/body/alert.list.jsp'. 
Check if it exists. Null property value for 'startingLocation' 
java.lang.IllegalArgumentException: Null property value for 
'startingLocation' at 
org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:755) 
at 
org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) 
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:891) 
at 
org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:286) 
at org.apache.jsp.alert$list$jsp._jspService(alert$list$jsp.java:419) 
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201) 
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) 
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360) 
at 
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294) 
at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:192) 
at org.mortbay.jetty.servlet.Dispatcher.include(Dispatcher.java:121) 
at 
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:820) 
at 
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:391) 
at 
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137) 
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177) at 
org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756) 
at 
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881) 
at 
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473) 
at org.apache.jsp.default$jsp._jspService(default$jsp.java:381) at 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201) 
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) 
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360) 
at 
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294) 
at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:192) 
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:129) 
at 
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069) 
at 
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274) 
at 
org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:254) 
at 
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309) 
at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) 
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480) 
at 
com.baselogic.yoursos.struts.ExtendedActionServlet.process(ExtendedActionServlet.java:40) 
at 
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at 
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360) 
at 
org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:342) 
at 
com.baselogic.yoursos.security.SecurityContextFilter.doFilter(SecurityContextFilter.java:102) 
at 
org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) 
at 
com.baselogic.yoursos.user.UserPreferenceFilter.doFilter(UserPreferenceFilter.java:48) 
at 
org.mortbay.jetty.servlet.WebApplicationHandler$Chain.doFilter(WebApplicationHandler.java:334) 
at 
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:286) 
at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558) 
at org.mortbay.http.HttpContext.handle(HttpContext.java:1714) at 
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507) 
at org.mortbay.http.HttpContext.handle(HttpContext.java:1664) at 
org.mortbay.http.HttpServer.service(HttpServer.java:863) at 
org.jboss.jetty.Jetty.service(Jetty.java:460) at 
org.mortbay.http.HttpConnection.service(HttpConnection.java:775) at 
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939) at 
org.mortbay.http.HttpConnection.handle(HttpConnection.java

Re: nested bean parameters

2003-06-28 Thread K.C. Baltz
What kind of output are you getting?  It is possible something is wrong 
with the logic:iterate rather than the bean:write?



Mick Knutson wrote:

I have a Collection of AlertDto's. Each AlertDto has a method called 
getStartingLocation() that returns a LocationDto. That LocationDto has 
a method called getLocationTitle().

How, in a JSP can I get the locationTitle?

I have tried:






---
Thanks...
Mick Knutson
---
_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: A question on Tiles and Frames

2003-06-28 Thread K.C. Baltz
Overflow is actually a standard CSS feature that IE only partially 
supports.  In Mozilla, you can do this with a lot more elements 
including tables where the header remains fixed while the data scrolls. 

K.C.

Mike Jasnowski wrote:

Well, depending on the web client you are using, IE has a feature that
enables some block level elements like  to be scrollable.  You can set
an "overflow" CSS property that enables a scrollbar to appear.There are
also cross-browser solutions for making independent (non-frame) scrollable
areas of content.
-Original Message-
From: Nimish Chourey , Tidel Park - Chennai
[mailto:[EMAIL PROTECTED]
Sent: Friday, June 20, 2003 9:42 AM
To: Struts Users Mailing List
Subject: RE: A question on Tiles and Frames
I had the same problem .. while developing a Menu (left side) .. wanted to
make that scrollable ..
But I guess its not possible with Tiles I guess ..  Infact try doing it
without tiles (and without frames) .. its not possible . And if somehow if
its really possible .. I would definately like to know that ..
-Original Message-
From: Jeff Kyser [mailto:[EMAIL PROTECTED]
Sent: Friday, June 20, 2003 5:57 PM
To: Struts Users Mailing List
Subject: Re: A question on Tiles and Frames
Okay. So is there *another* way to implement
independently scrollable content within a region of a page using Struts
and Tiles?
-jeff

On Friday, June 20, 2003, at 07:17  AM, Cedric Dumoulin wrote:

 

The page of a frame should alway be publicly accessible. It is alway
possible to access it directly without the other associated frames.
So, you can't hide them.
  Cedric

 Cedric

Jeff Kyser wrote:

   

Hey Cedric,

Thanks for the response. I guess I'd figured out I couldn't put them
under WEB-INF for the reasons you stated. So how can I implement
a scollable region such as a frame might offer and still use Tiles and
stay with some of the 'best practices' recommended for Struts
development such as hiding your JSPs under WEB-INF? I suppose
it gets off-topic, but surely there must be a way to have
independently
scrolled regions of a web page in a Struts environment without
making every page publicly accessible?
thanks, I'd sure like some insight as to how to proceed...

-jeff

 

Hi,

Each frame of a frameset is filled with a web page. Each one issue
an independent http request to the web server. So each page
corresponding to a frame should be publicly accessible on the web
server, and can't be under WEB-INF.
 Cedric
   

 

but I get Forbidden errors, presumably because my JSPs are beneath
the WEB-INF directory and
   

therefore not accessible.

Is there an alternate way to do this and still have my JSPs
underneath WEB-INF?
(Basically, I have a frames-based layout with a scrollable panel,
and am trying
to figure out how to best implement that feature using Struts/Tiles
without exposing all
my JSPs.
TIA,

-jeff


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [FRIDAY] Struts 1.1 votes passes, but, sadly, my cat died

2003-06-27 Thread K.C. Baltz


Adam Hardy wrote:

YOWSA!

The greatest pleasure is to crush your enemies and drive them before 
you, to deprive them of their wealth and see the faces of those dear  
to them bathed in tears, to ride upon...

This quote is from Ghengis Khan.

Now Adam, send me a copy of a book you've written.  :)

K.C.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Looking for File Upload Example

2003-06-26 Thread K.C. Baltz
If you downloaded the Struts binary distribution, try looking at the 
struts-upload webapp in the webapps/ directory of the distribution.  
Copying the .war file to your Tomcat/webapps dir should auto-deploy it 
and you should be able to direct your browser at 
http:///struts-upload  to see the example.

K.C.

Flo wrote:

Hi

i'm looking for un example of using File UPLOAD whith Struts API

The servlet and JSP code

Thanks

Flo

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [OT] IDE with easy tomcat upgrade?

2003-06-16 Thread K.C. Baltz
This discussion would likely be more productive on the nbusers email list. 

That being said, Netbeans can definitely attach to any properly 
configured external java process and remotely debug it.  How you 
actually configure that for Tomcat is a bit complicated, although it's 
much simpler for servlets than JSPs.  Google terms likely to yield 
useful info:  attach JPDA debug

K.C.

isaac wrote:

On 6/16/03 11:09 AM, "Aaron Longwell" <[EMAIL PROTECTED]> wrote:

 

Isaac,

I have been playing with Eclipse and NetBeans for a few days... I am
leaning toward NetBeans as well. The interface is a little clunkier..
and I'm not much of a fan of the "filesystems" concept.
I have a question about your "external Tomcat" comment. I have never
done servlet-debugging before... (in the real sense... of using a
debugger). NetBeans has that built-in Tomcat functionality... but I
can't figure out how to use it... especially to test a jsp in the
protected WEB-INF directory... (fronted by an Action of course).
Have you used the internal Tomcat before? Is there a way to use NetBeans
to debug an external servlet (I am running Tomcat as NT Service on WinXP).
Thanks,
Aaron
   

I don't believe you can monitor an external process. If you want to run your
project within NetBeans click on the "Runtime" tab. Under Server Registry ->
Installed Servers -> Tomcat, you will find the internal installation of
Tomcat. If you right click the icon you will see all of the options
available to you (starting, stopping, etc). The NetBeans installation runs
on port 8081. 

If you need to add an external installation of Tomcat, right click on the
"Tomcat" menu and select "Add Tomcat Installation". I am pretty sure this
will modify your server.xml file, so, make a back up...
I am not an expert on NetBeans by any means, so, I hope this helps.

Thanks,
Isaac
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]