You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mi...@barclayscapital.com on 2004/07/16 12:26:01 UTC

RE: How to Disable "open" button on "File Download" dialogue box. ...please urgent

Or a system design? So that these last-minute issues aren't all urgent?

-----Original Message-----
From: McCormack, Chris [mailto:Chris.McCormack@littlewoods.co.uk] 
Sent: 16 July 2004 11:19
To: Struts Users Mailing List
Subject: RE: How to Disable "open" button on "File Download" dialogue box.
...please urgent


Maybe a change of career or invest some time reading up the technologies
that appear on your CV ? Just a thought....

-----Original Message-----
From: ganesh gadi [mailto:ganeshi2t2@yahoo.com] 
Sent: 16 July 2004 09:52
To: user@struts.apache.org
Subject: How to Disable "open" button on "File Download" dialogue
box....please urgent


Hi Friends,

i'm very happy to tell u my problems and get answers.

i need a solution how to disable "open" button on 
"File Download" dialog box.i want control on it.
Pls don't say no solution.Bcox i saw that type of
dialogue box...Now i require that feature.
pls let me know the solution asap.

I used the following code to appear "File Download
box"

httpServletResponse.setContentLength((int) f.length));
              
httpServletResponse.setContentType(mimeType);
               
httpServletResponse.setHeader("Content-Disposition","attachment;filename="+f
.getName());

os =httpServletResponse.getOutputStream();
                stream = new FileInputStream(f);
                bis = new BufferedInputStream(stream);
                is = new BufferedInputStream(bis);
                int count;
                byte buf[] = new byte[4096];
                while ((count = is.read(buf)) > -1)
                os.write(buf, 0, count);


i'm using 
tomcat 5.0.19
Struts 1.1
IE 6.0
Windows 2000server

Thanks
Ganesh




		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


------------------------------------------------------------------------
For more information about Barclays Capital, please
visit our web site at http://www.barcap.com.


Internet communications are not secure and therefore the Barclays 
Group does not accept legal responsibility for the contents of this 
message.  Although the Barclays Group operates anti-virus programmes, 
it does not accept responsibility for any damage whatsoever that is 
caused by viruses being passed.  Any views or opinions presented are 
solely those of the author and do not necessarily represent those of the 
Barclays Group.  Replies to this email may be monitored by the Barclays 
Group for operational or business reasons.

------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


***********************************************
This e-mail and its attachments are confidential
and are intended for the above named recipient
only. If this has come to you in error, please 
notify the sender immediately and delete this 
e-mail from your system.
You must take no action based on this, nor must 
you copy or disclose it or any part of its contents 
to any person or organisation.
Statements and opinions contained in this email may 
not necessarily represent those of Littlewoods.
Please note that e-mail communications may be monitored.
The registered office of Littlewoods Limited and its subsidiaries is 100 Old
Hall Street, Liverpool, L70 1AB. Registered number of Littlewoods Limited is
262152.
************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Best practice request - dynamic link to redraw page

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
At 03:52 AM 7/16/2004, you wrote:
>On every page of the basket the contents of the basket are shown in a
>panel at the bottom of the page, and against each product is a 'delete'
>hyperlink.  When the user clicks on this link the product should be
>removed and the page refreshed to show the modified info.


Do you know that you can have different forwards for the same action?  E.g. 
"success", "failure", "delete", etc.? 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Best practice request - dynamic link to redraw page

Posted by pu...@tcs.com.
Jon,
The way it is managed is, while you paint the "delete" links in your HTML, 
you add a query string like this 

?itemid=xyz

and then in your action class method obtain the value of this variable 
itemid ( obviously through form-bean) 
and this is how single statement can do the work

Hope this answeres your query.

Regards,
Puneet Agarwal
Tata Consultancy Services
Mailto: puneet.a@tcs.com
Website: http://www.tcs.com



"Jon Barber" <jo...@acm.org> 
07/16/2004 04:22 PM

Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
"Struts Users Mailing List" <us...@struts.apache.org>
cc

Subject
Best practice request - dynamic link to redraw page






Dear All,

Trawled through the archive with no luck, but then I couldn't work out
the best search terms for this question, so.......

I'm writing a shopping basket app with the usual requirements, and using
tiles which has made things a lot less painful. However, I have this one
problem that I can't work out a nice way to solve.

On every page of the basket the contents of the basket are shown in a
panel at the bottom of the page, and against each product is a 'delete'
hyperlink.  When the user clicks on this link the product should be
removed and the page refreshed to show the modified info.

My question is - how to code the logic to do the deletion of the product
in such a way that the refreshing of the page is handled in a nice way ?
I have the usual way of using an Action to populate the contexts to
render the page, and then an Action to process the users response. When
a product is removed I will have to delete the product & then redirect
the user back to the Action to populate the page all over again.

As far as I can see I have 2 options :

1. Have one Action that performs the product removal and that accepts a
URL as a parameter that then redirects the user using that URL. I will
have to place the necessary URL in the context so that when the page is
rendered the redirect URL is set correctly for wherever the user is.
Painful & not very nice - every populate Action will have to put the
correct URL for itself into the context.

2. Have a seperate Action for every single delete page so that each
instance knows where to send the user back to. Not much different from 1
& leads to a lot of Actions.

Any ideas ? 

Am I missing the obvious ? For example, for 1 can I simply use the
present request URL as the URL to redirect the user to to redraw the
page ?

Jon.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


ForwardSourceID:NT000020A6 

Re: Best practice request - dynamic link to redraw page

Posted by Buland Altaf <bu...@yahoo.com>.
Dear,

First u need to set the hyperlink of the action(in
which u have implemented delete method logic) on the
primary key basis through which u will delete the
record and create an action forard in struts config
file(action of the class in which u have implementated
the logic to diaplay records in the view) and forward
to that action from delete method.

---------------- Struits-config.xml ----------------
<forward name="viewAction"
type="viewAction.do?parameter=methodName">
-----------------------------------------------------

------------------- View ----------------------------
<a href="deleteAction.do?primaryKey=xyz"> Delete </a>
(or use struts link tag)
-----------------------------------------------------

from delete action u need to forward to viewAction and
all display logic will be there.

Plz let me know in case of any inconvenience/problem.

regards,
Buland

--- Jon Barber <jo...@acm.org> wrote:
> Dear All,
> 
> Trawled through the archive with no luck, but then I
> couldn't work out
> the best search terms for this question, so.......
> 
> I'm writing a shopping basket app with the usual
> requirements, and using
> tiles which has made things a lot less painful.
> However, I have this one
> problem that I can't work out a nice way to solve.
> 
> On every page of the basket the contents of the
> basket are shown in a
> panel at the bottom of the page, and against each
> product is a 'delete'
> hyperlink.  When the user clicks on this link the
> product should be
> removed and the page refreshed to show the modified
> info.
> 
> My question is - how to code the logic to do the
> deletion of the product
> in such a way that the refreshing of the page is
> handled in a nice way ?
> I have the usual way of using an Action to populate
> the contexts to
> render the page, and then an Action to process the
> users response. When
> a product is removed I will have to delete the
> product & then redirect
> the user back to the Action to populate the page all
> over again.
> 
> As far as I can see I have 2 options :
> 
> 1. Have one Action that performs the product removal
> and that accepts a
> URL as a parameter that then redirects the user
> using that URL. I will
> have to place the necessary URL in the context so
> that when the page is
> rendered the redirect URL is set correctly for
> wherever the user is.
> Painful & not very nice - every populate Action will
> have to put the
> correct URL for itself into the context.
> 
> 2. Have a seperate Action for every single delete
> page so that each
> instance knows where to send the user back to. Not
> much different from 1
> & leads to a lot of Actions.
> 
> Any ideas ? 
> 
> Am I missing the obvious ? For example, for 1 can I
> simply use the
> present request URL as the URL to redirect the user
> to to redraw the
> page ?
> 
> Jon.
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 
> 


=====

Buland Altaf Malik,
Software Engineer, 
Softech System's(pvt)Ltd. 
10/25 asad jan road lahore,cantt - 54810 Pakistan
Tel: 92-42-6665812 , 92-42-6660802

Mob: 0333-4344113
Fax: 92-42-6665792

http://www.softech.com.pk
buland_altaf@hotmail.com




		
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Best practice request - dynamic link to redraw page

Posted by Jon Barber <jo...@acm.org>.
Dear All,

Trawled through the archive with no luck, but then I couldn't work out
the best search terms for this question, so.......

I'm writing a shopping basket app with the usual requirements, and using
tiles which has made things a lot less painful. However, I have this one
problem that I can't work out a nice way to solve.

On every page of the basket the contents of the basket are shown in a
panel at the bottom of the page, and against each product is a 'delete'
hyperlink.  When the user clicks on this link the product should be
removed and the page refreshed to show the modified info.

My question is - how to code the logic to do the deletion of the product
in such a way that the refreshing of the page is handled in a nice way ?
I have the usual way of using an Action to populate the contexts to
render the page, and then an Action to process the users response. When
a product is removed I will have to delete the product & then redirect
the user back to the Action to populate the page all over again.

As far as I can see I have 2 options :

1. Have one Action that performs the product removal and that accepts a
URL as a parameter that then redirects the user using that URL. I will
have to place the necessary URL in the context so that when the page is
rendered the redirect URL is set correctly for wherever the user is.
Painful & not very nice - every populate Action will have to put the
correct URL for itself into the context.

2. Have a seperate Action for every single delete page so that each
instance knows where to send the user back to. Not much different from 1
& leads to a lot of Actions.

Any ideas ? 

Am I missing the obvious ? For example, for 1 can I simply use the
present request URL as the URL to redirect the user to to redraw the
page ?

Jon.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org