Sessions Lost ?

2003-02-18 Thread Eddie Fung
Not sure if this is an Apache, Tomcat or Struts issue but here goes !

Has anyone experienced any problems with Sessions being lost between 
actions ? We have a situation where we place an object into Session Context 
and then forward to another Action (we are using Struts). We can clearly 
see that the object is being put into the Session Context but when we 
access the attribute at the other end it appears that the Session itself is 
'gone' - in some cases the request.getRequestedSessionId() is null or if it 
is not, the Session Creation Time is different to that of the session in 
the previous action. In either case the attribute we stored and tried to 
read is null..

We are using Apache and Tomcat and have mapped multiple domains within a 
single Tomcat instance. Is this an issue ? We do not pass sessions across 
multiple domains...

TIA

Eddie


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



Re: Forwarding and File Download problem

2002-11-25 Thread Eddie Fung
>>The only way I know of to suggest a filename to a browser is to output
>>the header

>>Content-disposition: attachment; filename=

>>However I think this only applies when you're dumping the file directly
>>after the header. Is this what you want to do?

>>Pontus

I am doing this and this works fine in naming the file when the actual SAVE 
dialog box is displayed. However prior to this it shows a box saying "You 
are downloading the file: xxx from localhost. Would you like to open the 
file or save it to your computer ? ". Unfortunately the name of the file 
(xxx) is the name of my action..

Thanks for your suggestion anyways..

Eddie


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Re: Forwarding and File Download problem

2002-11-21 Thread Eddie Fung
>> The reference you refer to is for upload, so I am a bit confused as you 
talk about download.

I believe the issues are the same and the previous posting appears to 
describe the same behavior..Simply that the data stream seems to 'prevent', 
in some way , the processing of the rest of the code ie. after the output 
stream is closed I can see that the  Action forward code is run but the JSP 
does not seem to have been forwarded to. If it had then the page would have 
been refreshed. I even tried to forward to the same action class but with a 
different action value so that it would 're-enter' itself and exit , 
forwarding to a JSP but it didn't work. It appears that the Controller is 
ignoring the forwarding that has been mapped in the struts-config.xml file...

>>You could experiment with using a refresh header tag in the page from 
which you launch the download, so that it refreshes every
>> seconds or so.

Unfortunately it is only when a file is downloaded that I need to show the 
'refresh' behavior..

Thanks anyway..

Eddie


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Forwarding and File Download problem

2002-11-20 Thread Eddie Fung
This is an old one but I have scoured the archives and not seen a 
definitive answer to my problem.

I am downloading a file via an Action class and want to refresh the Page 
display after the download completes. Now the action which should be 
forwarded to is not being executed. I have even tried to forward to a JSP 
rather than Action class but nothing seems to work.

This has been reported on more than one occasion eg:
http://nagoya.apache.org/eyebrowse/ReadMsg?[EMAIL PROTECTED]&msgId=154587

Never found a definitive answer.

Also the dialog box that IE pops up says that "you are downloading the 
file:   from localhost". This is misleading as the 
actual dialog box that is next presented correctly names the output file 
name that I have set up. How can I change the name of the file on the first 
dialog box ?


TIA

Eddie


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Action errors disappear ?

2002-02-28 Thread Eddie Fung

I am displaying errors using the ActionErrors facility and everything shows 
up nicely using the  tag.
However I have some local links to anchor points on the same web page ie. a 
have a nav bar which, when clicked on , will take you to another spot on 
the page. I've noticed that if the page has errors and I use one of these 
links, I get directed to the right place on the page but I lose all the 
error messages. I've noticed that the first local link seems to force an 
action in tomcat as though it's going to the server but after that all the 
hyperlinks seem local and don't go to the server anymore. Unfortunately I 
have lost the messages at this point

My question is : Can I use my local links to local anchor points without 
losing all the error messages ? I assume that the error messages are sent 
as response parameters and when the server gets a hit and replies, there 
are no such error messages attached to the response so the effect is that I 
'lose' the errors.

TIA

Eddie


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Error Messages and tags

2002-02-21 Thread Eddie Fung

Thanks for this ! I've decided to use the Message Tag..

Cheers

eddie
==
At 01:00 AM 21/02/2002, you wrote:
>1 - I do mean use ApplicationResources. You can look a message up from an
>Action as desribed here:-
>http://www.mail-archive.com/struts-user@jakarta.apache.org/msg21986.html
>Then use
>
>Your request has been accepted but with the
>following warning
>   
>
>to display it.
>
>With similar but more code you can set up an ArrayList or TreeMap(?) of
>messages.
>
>2 - Order is preserved in the later version of Struts. Not sure when it
>changed. but must be diff. from release version & the nightly builds. So now
>you can have in ApplicationResources.properties an 'error'
>common.warning.header=Your request has been
>accepted but with the following warning()s
>& add that before you add your message(s) to ActionErrrors.
>
>Personally I hate this sort of thing! In the world of business software
>functionality is worth spending money on not flashness (often not always).
>
>I'd say do it with just 1 message or use the new Messages tag.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Error Messages and tags

2002-02-20 Thread Eddie Fung

Keith,

not sure what you mean here re:

1- Do you mean don't bother using the ApplicationResources.properties and 
just return a String if we want only a single message ?
2- Can you explain how to set a special string for the 1st and last message 
? The errors I have are coming out in FIFO order at the moment (order SEEMS 
to be preserved) . Only with each message preceded by the header and 
followed by a footer..

Eddie
===
At 10:19 PM 20/02/2002, Keith wrote:
>1 - There is a new Messages tag in the nightly build. If you only need 1 
>mesage
>it's easy to code it yourself.
>2 - Don't do this - Use a blank string for header/footer & add your errors 
>with
>a wrapper class that adds a special string for the 1st & last message. The
>order of the errors is not preserved (in this release of struts) so you're
>header might come out last.
>
>--- Eddie Fung <[EMAIL PROTECTED]> wrote:
> > We have the text for error messages declared in the
> > ApplicationResources.properties file as per standard. We have the header
> > and footer text as required. Now is it possible to display the error
> > messages WITHOUT the header and footer in certain situations ? We'd 
> like to
> > re-use the messages and display them on the page without the header and
> > footer on a couple of pages. In one case the message is actually a warning
> > rather than error and to have the standard header (which indicates an
> > error) is a bit misleading.
> >
> > TIA
> >
> > Eddie
> >
> >
> > --
> > To unsubscribe, 
> e-mail:   <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> >
>
>
>=
>~~
>Search the archive:-
>http://www.mail-archive.com/struts-user%40jakarta.apache.org/
>~~
>Keith Bacon - Looking for struts work - South-East UK.
>phone UK 07960 011275
>
>__
>Do You Yahoo!?
>Yahoo! Sports - Coverage of the 2002 Olympic Games
>http://sports.yahoo.com
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


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




Error Messages and tags

2002-02-20 Thread Eddie Fung

We have the text for error messages declared in the 
ApplicationResources.properties file as per standard. We have the header 
and footer text as required. Now is it possible to display the error 
messages WITHOUT the header and footer in certain situations ? We'd like to 
re-use the messages and display them on the page without the header and 
footer on a couple of pages. In one case the message is actually a warning 
rather than error and to have the standard header (which indicates an 
error) is a bit misleading.

TIA

Eddie 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: iterate tag problems (sorry !!)

2001-12-06 Thread Eddie Fung

Dave,

thanks for your help on this. 'iterate will be the death of me'.. and me 
also !!

I've progressed further on this problem so that I am getting data to be 
passed to the Form. One big thing tho:

Each of the beans in the Arraylist that I am iterating thru has a field 
which is a boolean. I am representing this visually as a checkbox.
Now I understand with checkboxes that I have to set up a statement setting 
the field to false in the reset() method of the form so that struts can 
detect an unchecked box. However this would mean that I am resetting an 
attribute of the bean to suit struts. I guess this means that I would have 
to NOT represent the field as a checkbox but rather set up another  field 
separate to this attribute to be the visual representation and simply set 
the true attribute via the visual attribute then. In the reset() method I 
set all the visual checkboxes in the ArrayList to false.

Is this right ?

TIA

Eddie
=
At 04:24 AM 6/12/2001, you wrote:


>Hi Eddie,
>
> > BTW Dave Hay how does Struts match up the getMyObject method with the
>myObjectArray ??
>
>When Struts attempts to populate the form from the request, it takes the 
>name of
>the element in the request - in your case say "myObject[0].beanSelected" and
>translates this into a call on the form bean getMyObject(0) and then
>setBeanSelected(value) on the object that returns. ie
>getMyObject(0).setBeanSelected(value).
>
>You could take a look at the working example I just posted and see if you can
>find any differences.
>
>Hope that helps,
>
>Dave
>
>
>
>
>
>Eddie Fung <[EMAIL PROTECTED]> on 12/04/2001
>06:40:09 AM
>
>Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
>
>To:   [EMAIL PROTECTED]
>cc:(bcc: David Hay/Lex/Lexmark)
>Subject:  iterate tag problems (sorry !!)
>
>
>
>I've looked through the archives regarding the iterate tag and have
>followed all the suggestions on use of the  tag but still have a
>problem getting the form data to be updated. Yes I do have a
>getParameter(int index)
>method but I still can't get the data updated in the form.
>
>I have:
>
> property="myObjectArray"  indexId="index">
>
> indexed="true"/>
>
> indexed="true"/>
>  /
> indexed="true"/>
>  /
> maxlength="4"indexed="true"/>
>
>
>
>Where myForm = my ActionForm class
>
>myObjectArray is an ArrayList of myObjectBean objects
>
>I have the following defined in the myForm ActionForm:
>
>private ArrayList myObjectArray;
>
>public ArrayList getMyObjectArray()
>{
>  return myObjectArray ;
>}
>
>public void setMyObjectArray (ArrayList anArray)
>{
>  this.myObjectArray = anArray;
>}
>
>public myObjectBean getMyObject (int index)
>{
>  return (myObjectBean) getMyObjectArray.get(index);
>}
>
>The myObject class has public getters and setters for all fields.
>
>I can render the page but if I change the beanSelected, postDay, postMth or
>postYear
>fields the changes are not reflected in the Form.
>
>BTW Dave Hay how does Struts match up the getMyObject method with the
>myObjectArray ??
>
>TIA
>
>Eddie
>
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
>
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


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




iterate tag problems (sorry !!)

2001-12-04 Thread Eddie Fung

I've looked through the archives regarding the iterate tag and have
followed all the suggestions on use of the  tag but still have a
problem getting the form data to be updated. Yes I do have a 
getParameter(int index)
method but I still can't get the data updated in the form.

I have:






 /

 /




Where myForm = my ActionForm class

   myObjectArray is an ArrayList of myObjectBean objects

I have the following defined in the myForm ActionForm:

private ArrayList myObjectArray;

public ArrayList getMyObjectArray()
{
 return myObjectArray ;
}

public void setMyObjectArray (ArrayList anArray)
{
 this.myObjectArray = anArray;
}

public myObjectBean getMyObject (int index)
{
 return (myObjectBean) getMyObjectArray.get(index);
}

The myObject class has public getters and setters for all fields.

I can render the page but if I change the beanSelected, postDay, postMth or 
postYear
fields the changes are not reflected in the Form.

BTW Dave Hay how does Struts match up the getMyObject method with the 
myObjectArray ??

TIA

Eddie





--
To unsubscribe, e-mail:   
For additional commands, e-mail: