You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by ying lcs <yi...@gmail.com> on 2006/10/26 05:52:12 UTC

Use MyFaces for file download

Hi,

I am trying to write a Java web app using JSF.
I have a page which takes some info from user and it has a submit button.
If the validation of the info entered by user is correct, the web app
will send down a file.

All the example I look at has navigation rule while navigate from one
jsp to another. How can I send down a file instead of loading another
jsp?

Thank you.

Re: Use MyFaces for file download

Posted by Matthias Wessendorf <ma...@apache.org>.
ying,

yes it means <h:commandButton action="#{mybean.action}" value="Go!" />

in java:

public String action()
{
...
}


On 10/25/06, ying lcs <yi...@gmail.com> wrote:
> Matthias,
>
> Thanks for your link.
> Can you please help me understand what it means by 'You have to bind
> an action in the JSP to a method in your backing bean.'?
>
> Is there an example for that?
>
> Thanks again.
>
>
> On 10/25/06, Matthias Wessendorf <ma...@apache.org> wrote:
> > the myfaces wiki is a great source of already answered questions :)
> >
> > http://wiki.apache.org/myfaces/Sending_Files
> >
> >
> >
> > On 10/25/06, ying lcs <yi...@gmail.com> wrote:
> > > Hi,
> > >
> > > I am trying to write a Java web app using JSF.
> > > I have a page which takes some info from user and it has a submit button.
> > > If the validation of the info entered by user is correct, the web app
> > > will send down a file.
> > >
> > > All the example I look at has navigation rule while navigate from one
> > > jsp to another. How can I send down a file instead of loading another
> > > jsp?
> > >
> > > Thank you.
> > >
> >
> >
> > --
> > Matthias Wessendorf
> > http://tinyurl.com/fmywh
> >
> > further stuff:
> > blog: http://jroller.com/page/mwessendorf
> > mail: mwessendorf-at-gmail-dot-com
> >
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Use MyFaces for file download

Posted by Matthias Wessendorf <ma...@apache.org>.
yeah,

I suggest finishing that tutorial first, before doing a productive app.
The myfaces wiki has also good resources or links to them

jsfcentral.com might be interesting as well

Try to buy "The complete reference JavaServer Faces"
by Ed Burns (member of the guys that *create* JSF).

-M

On 10/25/06, ying lcs <yi...@gmail.com> wrote:
> Should I do something like this:
>
> <h:commandButton
>   value="#{bundle.Submit}"
>   action="#{cashier.submit}" />
>
> describe in here:
> http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFPage11.html
>
>
> On 10/25/06, ying lcs <yi...@gmail.com> wrote:
> > Matthias,
> >
> > Thanks for your link.
> > Can you please help me understand what it means by 'You have to bind
> > an action in the JSP to a method in your backing bean.'?
> >
> > Is there an example for that?
> >
> > Thanks again.
> >
> >
> > On 10/25/06, Matthias Wessendorf <ma...@apache.org> wrote:
> > > the myfaces wiki is a great source of already answered questions :)
> > >
> > > http://wiki.apache.org/myfaces/Sending_Files
> > >
> > >
> > >
> > > On 10/25/06, ying lcs <yi...@gmail.com> wrote:
> > > > Hi,
> > > >
> > > > I am trying to write a Java web app using JSF.
> > > > I have a page which takes some info from user and it has a submit button.
> > > > If the validation of the info entered by user is correct, the web app
> > > > will send down a file.
> > > >
> > > > All the example I look at has navigation rule while navigate from one
> > > > jsp to another. How can I send down a file instead of loading another
> > > > jsp?
> > > >
> > > > Thank you.
> > > >
> > >
> > >
> > > --
> > > Matthias Wessendorf
> > > http://tinyurl.com/fmywh
> > >
> > > further stuff:
> > > blog: http://jroller.com/page/mwessendorf
> > > mail: mwessendorf-at-gmail-dot-com
> > >
> >
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Use MyFaces for file download

Posted by ying lcs <yi...@gmail.com>.
Should I do something like this:

<h:commandButton
  value="#{bundle.Submit}"
  action="#{cashier.submit}" />

describe in here:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFPage11.html


On 10/25/06, ying lcs <yi...@gmail.com> wrote:
> Matthias,
>
> Thanks for your link.
> Can you please help me understand what it means by 'You have to bind
> an action in the JSP to a method in your backing bean.'?
>
> Is there an example for that?
>
> Thanks again.
>
>
> On 10/25/06, Matthias Wessendorf <ma...@apache.org> wrote:
> > the myfaces wiki is a great source of already answered questions :)
> >
> > http://wiki.apache.org/myfaces/Sending_Files
> >
> >
> >
> > On 10/25/06, ying lcs <yi...@gmail.com> wrote:
> > > Hi,
> > >
> > > I am trying to write a Java web app using JSF.
> > > I have a page which takes some info from user and it has a submit button.
> > > If the validation of the info entered by user is correct, the web app
> > > will send down a file.
> > >
> > > All the example I look at has navigation rule while navigate from one
> > > jsp to another. How can I send down a file instead of loading another
> > > jsp?
> > >
> > > Thank you.
> > >
> >
> >
> > --
> > Matthias Wessendorf
> > http://tinyurl.com/fmywh
> >
> > further stuff:
> > blog: http://jroller.com/page/mwessendorf
> > mail: mwessendorf-at-gmail-dot-com
> >
>

Re: Use MyFaces for file download

Posted by ying lcs <yi...@gmail.com>.
Matthias,

Thanks for your link.
Can you please help me understand what it means by 'You have to bind
an action in the JSP to a method in your backing bean.'?

Is there an example for that?

Thanks again.


On 10/25/06, Matthias Wessendorf <ma...@apache.org> wrote:
> the myfaces wiki is a great source of already answered questions :)
>
> http://wiki.apache.org/myfaces/Sending_Files
>
>
>
> On 10/25/06, ying lcs <yi...@gmail.com> wrote:
> > Hi,
> >
> > I am trying to write a Java web app using JSF.
> > I have a page which takes some info from user and it has a submit button.
> > If the validation of the info entered by user is correct, the web app
> > will send down a file.
> >
> > All the example I look at has navigation rule while navigate from one
> > jsp to another. How can I send down a file instead of loading another
> > jsp?
> >
> > Thank you.
> >
>
>
> --
> Matthias Wessendorf
> http://tinyurl.com/fmywh
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>

Re: Use MyFaces for file download

Posted by dani <da...@swisscom.com>.
Hi

I have a follow up question on this topic. I am also trying to download a
file (picture) in my aplication. I followed the instrcution on the Wiki page
but I have a content type problem. Eventhough I specify my content type to
"image/jpg" on the outputstrean, on the webpage I have still "text/html". 

Any suggestions?

Thanks
Daniel


Matthias Wessendorf-4 wrote:
> 
> the myfaces wiki is a great source of already answered questions :)
> 
> http://wiki.apache.org/myfaces/Sending_Files
> 
> 
> 
> On 10/25/06, ying lcs <yi...@gmail.com> wrote:
>> Hi,
>>
>> I am trying to write a Java web app using JSF.
>> I have a page which takes some info from user and it has a submit button.
>> If the validation of the info entered by user is correct, the web app
>> will send down a file.
>>
>> All the example I look at has navigation rule while navigate from one
>> jsp to another. How can I send down a file instead of loading another
>> jsp?
>>
>> Thank you.
>>
> 
> 
> -- 
> Matthias Wessendorf
> http://tinyurl.com/fmywh
> 
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
> 
> 

-- 
View this message in context: http://www.nabble.com/Use-MyFaces-for-file-download-tf2511718.html#a7008406
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Use MyFaces for file download

Posted by Matthias Wessendorf <ma...@apache.org>.
the myfaces wiki is a great source of already answered questions :)

http://wiki.apache.org/myfaces/Sending_Files



On 10/25/06, ying lcs <yi...@gmail.com> wrote:
> Hi,
>
> I am trying to write a Java web app using JSF.
> I have a page which takes some info from user and it has a submit button.
> If the validation of the info entered by user is correct, the web app
> will send down a file.
>
> All the example I look at has navigation rule while navigate from one
> jsp to another. How can I send down a file instead of loading another
> jsp?
>
> Thank you.
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com