You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ju...@mizuhocbus.com on 2004/04/06 21:40:02 UTC

How to convert struts FormFile to oracle blob Object?

Hi, I use <html file> upload  a file in FormFile format, anyone has any 
idea about how to set the file into the oracle database as a Blob object 
using JDBC?

Thank you very much.



= = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = 
This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the "Bank"). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained.
 = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = 


Re: Slightly OT How to set a request header using JSTL

Posted by Jim Collins <ja...@blueyonder.co.uk>.
Thanks for you help Craig. I think the <meta> tag looks the cleanest way and
I'll use that.

Regards

Jim.
----- Original Message ----- 
From: "Craig McClanahan" <cr...@apache.org>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, April 14, 2004 5:50 AM
Subject: Re: Slightly OT How to set a request header using JSTL


> Michael McGrady wrote:
>
> > Couldn't he wrap the response object inside a getter/setter facade?
> >
> I suppose one could do that, and even stick it (the response object)
> into the request attributes to make it visible to the EL via the
> "requestScope" magic variable.  But a property setter only takes a
> single argument (the value), so you'd need a property setter for every
> possible header (which is technically infeasible, since the set of
> possible headers is unbounded), and you still wouldn't be able to deal
> with the cases where more than one value for a header can be added (via
> response.addHeader()).
>
> It is a far far better thing :-) to just use the <meta> tag that HTML
> provides for exactly this sort of purpose.
>
>   <meta http-equiv="Header-Name" content="${the.value.for.this.header}">
>
> Besides the performance advantages of skipping all the mapping and
> facading, and making people scratch their heads over the resulting EL
> expressions, this has the advantage of clearly describing what's going
> on to anyone who is familiar with HTML.
>
> Craig
>
>
> > At 06:56 PM 4/13/2004, Craig McClanahan wrote:
> >
> >> Jim Collins wrote:
> >>
> >>> Hi Craig,
> >>>
> >>> Thanks for your response. I wanted to set the header in the JSP page
> >>> itself.
> >>> At the moment I set the header using a scriptlet (as you described
> >>> in your
> >>> post) but I would like to disable scriptlets in my JSP pages.
> >>> I was playing around with the EL and could print out the headers
> >>> using this
> >>> but I could find no way to set a header. I believe that Struts
> >>> provide a tag
> >>> that encapsulates the response that I could manipulate using the EL
> >>> but I
> >>> was wondering if I could do it using the explicit response object in
> >>> the EL.
> >>>
> >>>
> >> Unfortunately the "response" implicit object (that the JSP page
> >> compiler provides) is not visible through the EL directly.  Even if
> >> it were, however, it wouldn't help much because you can only call
> >> property getters with EL expressions; not arbitrary methods with
> >> arbitrary parameters.
> >>
> >>> Regards
> >>>
> >>> Jim.
> >>>
> >>
> >> Craig
> >>
> >>
> >>> ----- Original Message ----- From: "Craig McClanahan"
> >>> <cr...@apache.org>
> >>> To: "Struts Users Mailing List" <us...@struts.apache.org>
> >>> Sent: Tuesday, April 13, 2004 10:48 PM
> >>> Subject: Re: Slightly OT How to set a request header using JSTL
> >>>
> >>>
> >>>
> >>>
> >>>> Jim Collins wrote:
> >>>>
> >>>>
> >>>>
> >>>>> Hi,
> >>>>>
> >>>>> Has anyone any thoughts on this?
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>> The "header" object relates to the *request* headers.  You can set
> >>>> *response* headers in a number of ways:
> >>>>
> >>>> * (Servlet 2.3 or later) in a Filter that wraps and postprocesses
> >>>>  the response
> >>>>
> >>>> * In your Action (although that only works if you also do the output
> >>>>  itself; doing a request dispatcher forward will clear the headers).
> >>>>
> >>>> * In a JSP page with scriptlets (as long as it's before the response
> >>>>  is committed):
> >>>>
> >>>>  <%
> >>>>    response.setHeader("Foo", "bar");
> >>>>  %>
> >>>>
> >>>> * In a JSP page with HTML <meta> tags in the <head> section:
> >>>>
> >>>>  <meta http-equiv="Foo" content="bar">
> >>>>
> >>>> * (JSP 2.0 or later) you can use EL expressions to get the value part
> >>>>  of the header from a bean property dynamically:
> >>>>
> >>>>  <meta http-equiv="Foo" content="${mybean.fooValue}">
> >>>>
> >>>> * Ugly but workable using a Struts tag get the dynamic value:
> >>>>
> >>>>  <meta http-equiv="Foo"
> >>>>   content='<bean:write name="mybean" property="fooValue"/>'>
> >>>>
> >>>>  This only works because <meta> is not a custom tag; otherwise
> >>>>  the nesting syntax would be illegal.
> >>>>
> >>>>
> >>>>
> >>>>> Thanks
> >>>>>
> >>>>> Jim.
> >>>>>
> >>>>>
> >>>>>
> >>>> Craig
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>> ----- Original Message ----- From: "Jim Collins"
> >>>>> <ja...@blueyonder.co.uk>
> >>>>> To: "Struts Users Mailing List" <us...@struts.apache.org>
> >>>>> Sent: Tuesday, April 06, 2004 10:10 PM
> >>>>> Subject: Slightly OT How to set a request header using JSTL
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> I know how I can read request headers using c:out and the header
> >>>>>> object.
> >>>>>> Does anyone know how I can set a response header using c:set? Can
> >>>>>> it be
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>> done
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>> without using the response tag? I don't want to use scriptlets.
> >>>>>>
> >>>>>> Thanks
> >>>>>>
> >>>>>> Jim.
> >>>>>>
> >>>>>>
>
>>>>>> --------------------------------------------------------------------- 
> >>>>>>
> >>>>>> 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
> >>>>>
> >>>>>
> >>>>>
> >>>> ---------------------------------------------------------------------
> >>>> 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
> >>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
>
>
>
> ---------------------------------------------------------------------
> 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: Slightly OT How to set a request header using JSTL

Posted by Craig McClanahan <cr...@apache.org>.
Michael McGrady wrote:

> Couldn't he wrap the response object inside a getter/setter facade?
>
I suppose one could do that, and even stick it (the response object) 
into the request attributes to make it visible to the EL via the 
"requestScope" magic variable.  But a property setter only takes a 
single argument (the value), so you'd need a property setter for every 
possible header (which is technically infeasible, since the set of 
possible headers is unbounded), and you still wouldn't be able to deal 
with the cases where more than one value for a header can be added (via 
response.addHeader()).

It is a far far better thing :-) to just use the <meta> tag that HTML 
provides for exactly this sort of purpose.

  <meta http-equiv="Header-Name" content="${the.value.for.this.header}">

Besides the performance advantages of skipping all the mapping and 
facading, and making people scratch their heads over the resulting EL 
expressions, this has the advantage of clearly describing what's going 
on to anyone who is familiar with HTML.

Craig


> At 06:56 PM 4/13/2004, Craig McClanahan wrote:
>
>> Jim Collins wrote:
>>
>>> Hi Craig,
>>>
>>> Thanks for your response. I wanted to set the header in the JSP page 
>>> itself.
>>> At the moment I set the header using a scriptlet (as you described 
>>> in your
>>> post) but I would like to disable scriptlets in my JSP pages.
>>> I was playing around with the EL and could print out the headers 
>>> using this
>>> but I could find no way to set a header. I believe that Struts 
>>> provide a tag
>>> that encapsulates the response that I could manipulate using the EL 
>>> but I
>>> was wondering if I could do it using the explicit response object in 
>>> the EL.
>>>
>>>
>> Unfortunately the "response" implicit object (that the JSP page 
>> compiler provides) is not visible through the EL directly.  Even if 
>> it were, however, it wouldn't help much because you can only call 
>> property getters with EL expressions; not arbitrary methods with 
>> arbitrary parameters.
>>
>>> Regards
>>>
>>> Jim.
>>>
>>
>> Craig
>>
>>
>>> ----- Original Message ----- From: "Craig McClanahan" 
>>> <cr...@apache.org>
>>> To: "Struts Users Mailing List" <us...@struts.apache.org>
>>> Sent: Tuesday, April 13, 2004 10:48 PM
>>> Subject: Re: Slightly OT How to set a request header using JSTL
>>>
>>>
>>>
>>>
>>>> Jim Collins wrote:
>>>>
>>>>
>>>>
>>>>> Hi,
>>>>>
>>>>> Has anyone any thoughts on this?
>>>>>
>>>>>
>>>>>
>>>>>
>>>> The "header" object relates to the *request* headers.  You can set
>>>> *response* headers in a number of ways:
>>>>
>>>> * (Servlet 2.3 or later) in a Filter that wraps and postprocesses
>>>>  the response
>>>>
>>>> * In your Action (although that only works if you also do the output
>>>>  itself; doing a request dispatcher forward will clear the headers).
>>>>
>>>> * In a JSP page with scriptlets (as long as it's before the response
>>>>  is committed):
>>>>
>>>>  <%
>>>>    response.setHeader("Foo", "bar");
>>>>  %>
>>>>
>>>> * In a JSP page with HTML <meta> tags in the <head> section:
>>>>
>>>>  <meta http-equiv="Foo" content="bar">
>>>>
>>>> * (JSP 2.0 or later) you can use EL expressions to get the value part
>>>>  of the header from a bean property dynamically:
>>>>
>>>>  <meta http-equiv="Foo" content="${mybean.fooValue}">
>>>>
>>>> * Ugly but workable using a Struts tag get the dynamic value:
>>>>
>>>>  <meta http-equiv="Foo"
>>>>   content='<bean:write name="mybean" property="fooValue"/>'>
>>>>
>>>>  This only works because <meta> is not a custom tag; otherwise
>>>>  the nesting syntax would be illegal.
>>>>
>>>>
>>>>
>>>>> Thanks
>>>>>
>>>>> Jim.
>>>>>
>>>>>
>>>>>
>>>> Craig
>>>>
>>>>
>>>>
>>>>
>>>>> ----- Original Message ----- From: "Jim Collins" 
>>>>> <ja...@blueyonder.co.uk>
>>>>> To: "Struts Users Mailing List" <us...@struts.apache.org>
>>>>> Sent: Tuesday, April 06, 2004 10:10 PM
>>>>> Subject: Slightly OT How to set a request header using JSTL
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I know how I can read request headers using c:out and the header 
>>>>>> object.
>>>>>> Does anyone know how I can set a response header using c:set? Can 
>>>>>> it be
>>>>>>
>>>>>>
>>>>>>
>>>>> done
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> without using the response tag? I don't want to use scriptlets.
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Jim.
>>>>>>
>>>>>>
>>>>>> --------------------------------------------------------------------- 
>>>>>>
>>>>>> 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
>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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



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


Re: Slightly OT How to set a request header using JSTL

Posted by Michael McGrady <mi...@michaelmcgrady.com>.
Couldn't he wrap the response object inside a getter/setter facade?

At 06:56 PM 4/13/2004, Craig McClanahan wrote:
>Jim Collins wrote:
>
>>Hi Craig,
>>
>>Thanks for your response. I wanted to set the header in the JSP page itself.
>>At the moment I set the header using a scriptlet (as you described in your
>>post) but I would like to disable scriptlets in my JSP pages.
>>I was playing around with the EL and could print out the headers using this
>>but I could find no way to set a header. I believe that Struts provide a tag
>>that encapsulates the response that I could manipulate using the EL but I
>>was wondering if I could do it using the explicit response object in the EL.
>>
>>
>Unfortunately the "response" implicit object (that the JSP page compiler 
>provides) is not visible through the EL directly.  Even if it were, 
>however, it wouldn't help much because you can only call property getters 
>with EL expressions; not arbitrary methods with arbitrary parameters.
>
>>Regards
>>
>>Jim.
>>
>
>Craig
>
>
>>----- Original Message ----- From: "Craig McClanahan" <cr...@apache.org>
>>To: "Struts Users Mailing List" <us...@struts.apache.org>
>>Sent: Tuesday, April 13, 2004 10:48 PM
>>Subject: Re: Slightly OT How to set a request header using JSTL
>>
>>
>>
>>
>>>Jim Collins wrote:
>>>
>>>
>>>
>>>>Hi,
>>>>
>>>>Has anyone any thoughts on this?
>>>>
>>>>
>>>>
>>>>
>>>The "header" object relates to the *request* headers.  You can set
>>>*response* headers in a number of ways:
>>>
>>>* (Servlet 2.3 or later) in a Filter that wraps and postprocesses
>>>  the response
>>>
>>>* In your Action (although that only works if you also do the output
>>>  itself; doing a request dispatcher forward will clear the headers).
>>>
>>>* In a JSP page with scriptlets (as long as it's before the response
>>>  is committed):
>>>
>>>  <%
>>>    response.setHeader("Foo", "bar");
>>>  %>
>>>
>>>* In a JSP page with HTML <meta> tags in the <head> section:
>>>
>>>  <meta http-equiv="Foo" content="bar">
>>>
>>>* (JSP 2.0 or later) you can use EL expressions to get the value part
>>>  of the header from a bean property dynamically:
>>>
>>>  <meta http-equiv="Foo" content="${mybean.fooValue}">
>>>
>>>* Ugly but workable using a Struts tag get the dynamic value:
>>>
>>>  <meta http-equiv="Foo"
>>>   content='<bean:write name="mybean" property="fooValue"/>'>
>>>
>>>  This only works because <meta> is not a custom tag; otherwise
>>>  the nesting syntax would be illegal.
>>>
>>>
>>>
>>>>Thanks
>>>>
>>>>Jim.
>>>>
>>>>
>>>>
>>>Craig
>>>
>>>
>>>
>>>
>>>>----- Original Message ----- From: "Jim Collins" 
>>>><ja...@blueyonder.co.uk>
>>>>To: "Struts Users Mailing List" <us...@struts.apache.org>
>>>>Sent: Tuesday, April 06, 2004 10:10 PM
>>>>Subject: Slightly OT How to set a request header using JSTL
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>I know how I can read request headers using c:out and the header object.
>>>>>Does anyone know how I can set a response header using c:set? Can it be
>>>>>
>>>>>
>>>>>
>>>>done
>>>>
>>>>
>>>>
>>>>
>>>>>without using the response tag? I don't want to use scriptlets.
>>>>>
>>>>>Thanks
>>>>>
>>>>>Jim.
>>>>>
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>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
>>>>
>>>>
>>>>
>>>---------------------------------------------------------------------
>>>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
>>
>
>
>---------------------------------------------------------------------
>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: Slightly OT How to set a request header using JSTL

Posted by Craig McClanahan <cr...@apache.org>.
Jim Collins wrote:

>Hi Craig,
>
>Thanks for your response. I wanted to set the header in the JSP page itself.
>At the moment I set the header using a scriptlet (as you described in your
>post) but I would like to disable scriptlets in my JSP pages.
>I was playing around with the EL and could print out the headers using this
>but I could find no way to set a header. I believe that Struts provide a tag
>that encapsulates the response that I could manipulate using the EL but I
>was wondering if I could do it using the explicit response object in the EL.
>
>  
>
Unfortunately the "response" implicit object (that the JSP page compiler 
provides) is not visible through the EL directly.  Even if it were, 
however, it wouldn't help much because you can only call property 
getters with EL expressions; not arbitrary methods with arbitrary 
parameters.

>Regards
>
>Jim.
>  
>

Craig


>----- Original Message ----- 
>From: "Craig McClanahan" <cr...@apache.org>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Sent: Tuesday, April 13, 2004 10:48 PM
>Subject: Re: Slightly OT How to set a request header using JSTL
>
>
>  
>
>>Jim Collins wrote:
>>
>>    
>>
>>>Hi,
>>>
>>>Has anyone any thoughts on this?
>>>
>>>
>>>
>>>      
>>>
>>The "header" object relates to the *request* headers.  You can set
>>*response* headers in a number of ways:
>>
>>* (Servlet 2.3 or later) in a Filter that wraps and postprocesses
>>  the response
>>
>>* In your Action (although that only works if you also do the output
>>  itself; doing a request dispatcher forward will clear the headers).
>>
>>* In a JSP page with scriptlets (as long as it's before the response
>>  is committed):
>>
>>  <%
>>    response.setHeader("Foo", "bar");
>>  %>
>>
>>* In a JSP page with HTML <meta> tags in the <head> section:
>>
>>  <meta http-equiv="Foo" content="bar">
>>
>>* (JSP 2.0 or later) you can use EL expressions to get the value part
>>  of the header from a bean property dynamically:
>>
>>  <meta http-equiv="Foo" content="${mybean.fooValue}">
>>
>>* Ugly but workable using a Struts tag get the dynamic value:
>>
>>  <meta http-equiv="Foo"
>>   content='<bean:write name="mybean" property="fooValue"/>'>
>>
>>  This only works because <meta> is not a custom tag; otherwise
>>  the nesting syntax would be illegal.
>>
>>    
>>
>>>Thanks
>>>
>>>Jim.
>>>
>>>
>>>      
>>>
>>Craig
>>
>>
>>    
>>
>>>----- Original Message ----- 
>>>From: "Jim Collins" <ja...@blueyonder.co.uk>
>>>To: "Struts Users Mailing List" <us...@struts.apache.org>
>>>Sent: Tuesday, April 06, 2004 10:10 PM
>>>Subject: Slightly OT How to set a request header using JSTL
>>>
>>>
>>>
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>>I know how I can read request headers using c:out and the header object.
>>>>Does anyone know how I can set a response header using c:set? Can it be
>>>>
>>>>
>>>>        
>>>>
>>>done
>>>
>>>
>>>      
>>>
>>>>without using the response tag? I don't want to use scriptlets.
>>>>
>>>>Thanks
>>>>
>>>>Jim.
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>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
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>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
>  
>


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


Re: Slightly OT How to set a request header using JSTL

Posted by Jim Collins <ja...@blueyonder.co.uk>.
Hi Craig,

Thanks for your response. I wanted to set the header in the JSP page itself.
At the moment I set the header using a scriptlet (as you described in your
post) but I would like to disable scriptlets in my JSP pages.
I was playing around with the EL and could print out the headers using this
but I could find no way to set a header. I believe that Struts provide a tag
that encapsulates the response that I could manipulate using the EL but I
was wondering if I could do it using the explicit response object in the EL.

Regards

Jim.
----- Original Message ----- 
From: "Craig McClanahan" <cr...@apache.org>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, April 13, 2004 10:48 PM
Subject: Re: Slightly OT How to set a request header using JSTL


> Jim Collins wrote:
>
> >Hi,
> >
> >Has anyone any thoughts on this?
> >
> >
> >
> The "header" object relates to the *request* headers.  You can set
> *response* headers in a number of ways:
>
> * (Servlet 2.3 or later) in a Filter that wraps and postprocesses
>   the response
>
> * In your Action (although that only works if you also do the output
>   itself; doing a request dispatcher forward will clear the headers).
>
> * In a JSP page with scriptlets (as long as it's before the response
>   is committed):
>
>   <%
>     response.setHeader("Foo", "bar");
>   %>
>
> * In a JSP page with HTML <meta> tags in the <head> section:
>
>   <meta http-equiv="Foo" content="bar">
>
> * (JSP 2.0 or later) you can use EL expressions to get the value part
>   of the header from a bean property dynamically:
>
>   <meta http-equiv="Foo" content="${mybean.fooValue}">
>
> * Ugly but workable using a Struts tag get the dynamic value:
>
>   <meta http-equiv="Foo"
>    content='<bean:write name="mybean" property="fooValue"/>'>
>
>   This only works because <meta> is not a custom tag; otherwise
>   the nesting syntax would be illegal.
>
> >Thanks
> >
> >Jim.
> >
> >
>
> Craig
>
>
> >----- Original Message ----- 
> >From: "Jim Collins" <ja...@blueyonder.co.uk>
> >To: "Struts Users Mailing List" <us...@struts.apache.org>
> >Sent: Tuesday, April 06, 2004 10:10 PM
> >Subject: Slightly OT How to set a request header using JSTL
> >
> >
> >
> >
> >>Hi,
> >>
> >>I know how I can read request headers using c:out and the header object.
> >>Does anyone know how I can set a response header using c:set? Can it be
> >>
> >>
> >done
> >
> >
> >>without using the response tag? I don't want to use scriptlets.
> >>
> >>Thanks
> >>
> >>Jim.
> >>
> >>
> >>---------------------------------------------------------------------
> >>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
> >
> >
>
>
> ---------------------------------------------------------------------
> 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: Slightly OT How to set a request header using JSTL

Posted by Craig McClanahan <cr...@apache.org>.
Jim Collins wrote:

>Hi,
>
>Has anyone any thoughts on this?
>
>  
>
The "header" object relates to the *request* headers.  You can set 
*response* headers in a number of ways:

* (Servlet 2.3 or later) in a Filter that wraps and postprocesses
  the response

* In your Action (although that only works if you also do the output
  itself; doing a request dispatcher forward will clear the headers).

* In a JSP page with scriptlets (as long as it's before the response
  is committed):

  <%
    response.setHeader("Foo", "bar");
  %>

* In a JSP page with HTML <meta> tags in the <head> section:

  <meta http-equiv="Foo" content="bar">

* (JSP 2.0 or later) you can use EL expressions to get the value part
  of the header from a bean property dynamically:

  <meta http-equiv="Foo" content="${mybean.fooValue}">

* Ugly but workable using a Struts tag get the dynamic value:

  <meta http-equiv="Foo"
   content='<bean:write name="mybean" property="fooValue"/>'>

  This only works because <meta> is not a custom tag; otherwise
  the nesting syntax would be illegal.

>Thanks
>
>Jim.
>  
>

Craig


>----- Original Message ----- 
>From: "Jim Collins" <ja...@blueyonder.co.uk>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Sent: Tuesday, April 06, 2004 10:10 PM
>Subject: Slightly OT How to set a request header using JSTL
>
>
>  
>
>>Hi,
>>
>>I know how I can read request headers using c:out and the header object.
>>Does anyone know how I can set a response header using c:set? Can it be
>>    
>>
>done
>  
>
>>without using the response tag? I don't want to use scriptlets.
>>
>>Thanks
>>
>>Jim.
>>
>>
>>---------------------------------------------------------------------
>>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
>  
>


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


Re: Slightly OT How to set a request header using JSTL

Posted by Jim Collins <ja...@blueyonder.co.uk>.
Hi,

Has anyone any thoughts on this?

Thanks

Jim.
----- Original Message ----- 
From: "Jim Collins" <ja...@blueyonder.co.uk>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, April 06, 2004 10:10 PM
Subject: Slightly OT How to set a request header using JSTL


> Hi,
>
> I know how I can read request headers using c:out and the header object.
> Does anyone know how I can set a response header using c:set? Can it be
done
> without using the response tag? I don't want to use scriptlets.
>
> Thanks
>
> Jim.
>
>
> ---------------------------------------------------------------------
> 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


Slightly OT How to set a request header using JSTL

Posted by Jim Collins <ja...@blueyonder.co.uk>.
Hi,

I know how I can read request headers using c:out and the header object.
Does anyone know how I can set a response header using c:set? Can it be done
without using the response tag? I don't want to use scriptlets.

Thanks

Jim.


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


Re: How to convert struts FormFile to oracle blob Object?

Posted by Bill Siggelkow <bi...@bellsouth.net>.
Basically, from the FormFile you can get an input Stream for reading -- 
the hardpart is writing to the Oracle Blob -- here are some links that 
should help:

http://otn.oracle.com/ultrasearch/wwws_otn/searchotn.jsp?p_Action=Search&p_Query=jdbc+blob&Advanced.x=0&Advanced.y=0

Julie.Huang@mizuhocbus.com wrote:
> Hi, I use <html file> upload  a file in FormFile format, anyone has any 
> idea about how to set the file into the oracle database as a Blob object 
> using JDBC?
> 
> Thank you very much.
> 
> 
> 
> = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = 
> This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the "Bank"). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained.
>  = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = 
> 
> 


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