read/display image from Database using struts

2006-12-18 Thread Kranti
Hi, How should I read/display image from Database...which is stored interms of bytes in the Database. Please suggest me some way to render the image in JSP.

Re: read/display image from Database using struts

2006-12-18 Thread Dariusz Wojtas
Custom servlet which retrieves data from DB, writes it to the output stream. It should define correct headers first (mimeType, Expires, Date). Map it to some url like /images/* and you may pass identifiers by composing URLs like /images/myID.jpg Dariusz Wojtas On 12/18/06, Kranti [EMAIL

Re: read/display image from Database using struts

2006-12-18 Thread Kranti
Dear Dariusz , this is the first time for me to solve this kind of problem. could you provide some sample code to address this. thanks in advance On 12/18/06, Dariusz Wojtas [EMAIL PROTECTED] wrote: Custom servlet which retrieves data from DB, writes it to the output stream. It should

RE: read/display image from Database using struts

2006-12-18 Thread mano dasanayake
Hi kranti, You have to use BLOB's to store images in the DB.. Get the Out Stream from the BLOB and then write the byte[] to it.. http://wiki.apache.org/struts/StrutsFileUpload Regards, Mano -Original Message- From: Kranti [mailto:[EMAIL PROTECTED] Sent: Monday, December 18, 2006

Re: read/display image from Database using struts

2006-12-18 Thread Niall Pemberton
Alternatively you could use a download action: http://wiki.apache.org/struts/StrutsFileDownload Niall On 12/18/06, Dariusz Wojtas [EMAIL PROTECTED] wrote: Custom servlet which retrieves data from DB, writes it to the output stream. It should define correct headers first (mimeType, Expires,

validatorform NoSuchMethodError

2006-12-18 Thread Kranti
* i am using validatorform for validating the fields it is giving java.lang.NoSuchMethodError: org.apache.commons.validator.Validator.addResource (Ljava/lang/String;Ljava/lang/Object please suggest *

Re: read/display image from Database using struts

2006-12-18 Thread Dariusz Wojtas
On 12/18/06, Kranti [EMAIL PROTECTED] wrote: Dear Dariusz , this is the first time for me to solve this kind of problem. could you provide some sample code to address this. thanks in advance This is something simplified, may not compile - but exactly shows what needs to be done. Passing of

[OT] Re: read/display image from Database using struts

2006-12-18 Thread Antonio Petrelli
Dariusz Wojtas ha scritto: On 12/18/06, Kranti [EMAIL PROTECTED] wrote: Dear Dariusz , this is the first time for me to solve this kind of problem. could you provide some sample code to address this. thanks in advance This is something simplified, may not compile - but exactly shows

Re: [OT] Re: read/display image from Database using struts

2006-12-18 Thread Kranti
Thank you very much Dariusz. I shall try this and update you. On 12/18/06, Antonio Petrelli [EMAIL PROTECTED] wrote: Dariusz Wojtas ha scritto: On 12/18/06, Kranti [EMAIL PROTECTED] wrote: Dear Dariusz , this is the first time for me to solve this kind of problem. could you provide some

S2:The value of checkbox getted in server-side is false when no any checkbox been selected.

2006-12-18 Thread Denis Ling
jsp section: s:iterator value=%{#request.rolePs.items} id=role status=status tr td height=25 width=5% s:checkbox name=roleId fieldValue=%{id} theme=simple/ /td /tr /s:iterator action section: private String[] roleId;

MessageResourcesFactory.createFactory java.lang.VerifyError: (class: org/apache/struts/util/RequestUtils, method: getActionMappingURL signature: (Ljava/lang/String;Ljavax/servlet/jsp/PageContext;

2006-12-18 Thread malin76
Hi, I'm having problems starting up an Struts application in Websphere application server. Below is the error message I get, does anyone know how to fix this? Thanks, Malin INFO org.apache.struts.action.ActionServlet - inside init [2006-12-18 11:46:45:340 CET] 33b9f334 SystemOut O

Re: Can it be done in Struts

2006-12-18 Thread ahmet hassan
You may try this; html:textvalue=${object.value}/ Krishna, Hari (FTT-CInternet) [EMAIL PROTECTED] wrote: Hi I have a peculiar requirement where i have to show user selected questions and their corresponding answers in text boxes in the

RE: No taglib element in web.xml v2.4 ?

2006-12-18 Thread Dave Newton
From: Thomas Thomas [mailto:[EMAIL PROTECTED] Weird that in Eclipse it doesnt show the taglib element ! But I placed this somewhere and it works ! You don't need taglib directives in 2.4. Dave - To unsubscribe, e-mail:

RE: logic:present in struts2

2006-12-18 Thread Dave Newton
s:if? -Original Message- From: red phoenix [mailto:[EMAIL PROTECTED] Sent: Sunday, December 17, 2006 8:26 PM To: Struts Users Mailing List Subject: logic:present in struts2 I want to realize logic:present in Struts2,when session attribute is exist,it show login,if it is not

RE: S2:The value of checkbox getted in server-side is false when no any checkbox been selected.

2006-12-18 Thread Dave Newton
From: Denis Ling [mailto:[EMAIL PROTECTED] the retrieved value of roleId is {false} when user doesn't select any checkbox elements. In my opinion, this case should returns null directly. Why? S2 automagically deals with one of the headaches of HTTP (not returning unchecked box values) by

RE: No taglib element in web.xml v2.4 ?

2006-12-18 Thread Dave Newton
From: Dave Newton [mailto:[EMAIL PROTECTED] From: Thomas Thomas [mailto:[EMAIL PROTECTED] Weird that in Eclipse it doesnt show the taglib element ! But I placed this somewhere and it works ! You don't need taglib directives in 2.4. Um, just to clarify, I meant you don't need them in

Re: No taglib element in web.xml v2.4 ?

2006-12-18 Thread Vijay Venkataraman
Mikolaj Rydzewski wrote: Thomas Thomas wrote: Well how am I supposed to declare my Struts taglibs then ? You don't. All tld files are present in META-INF directory of specific jars. Servlet container looks for those files in that location and it works ;-) Of course you can still put tld

Re: DynaValidatorForm - cannot find bean

2006-12-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Philippe, Pille wrote: how can i set a property of the form, that is used and needed in the jsp of the form after editing? I usually add that property to the form bean itself and then use a hidden parameter. For instance, if I'm editing a database

Re: DynaValidatorForm - cannot find bean

2006-12-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Philippe, Pille wrote: how can i access the getters and setters in of a DynaValidatorForm from within an action method? You can use them as before. when i had a own form class i could do the following in a action method: productForm =

RE: [s2] CheckBox issues

2006-12-18 Thread Shardayyy
Why don't you try this FORM = Private String permission = N;// set the default to N JSP === html:checkbox property=permission value=Y/ DATABASE = -- You would store a char(1) in the DB If the check box IS checked and submitted the Y values gets submitted to the backend,

[S2] Spring autowiring question...

2006-12-18 Thread Dave Newton
Hi, I am currently using the Spring autowiring functionality. Is this a bad idea due to someone being able to craft a request that might walk on one of the injected objects? (Unlikely perhaps, but...) Thanks, Dave - To

Re: [S2] Spring autowiring question...

2006-12-18 Thread Ted Husted
If I understand the question, it's not specifc to Spring. It wouldn't matter how the domain objects are being crated, only what can be done with them once they exist. If there are problematic properties on the domain objects, then sure. But many domain objects are simply value or data transfer

RE: [S2] Spring autowiring question...

2006-12-18 Thread Dave Newton
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of If I understand the question, it's not specifc to Spring. It wouldn't matter how the domain objects are being crated, only what can be done with them once they exist. Correct; as an example I'm injecting DAOs into my Actions (or

Re: DynaValidatorForm - cannot find bean

2006-12-18 Thread Pille
Christopher Schultz wrote: Philippe, Pille wrote: how can i set a property of the form, that is used and needed in the jsp of the form after editing? I usually add that property to the form bean itself and then use a hidden parameter. For instance, if I'm editing a database record, I

Re: DynaValidatorForm - cannot find bean

2006-12-18 Thread Pille
mano dasanayake wrote: Hi, Use PropertyUtils.setSimpleProperty(yourForm,proptyName,object); And PropertyUtils.getsimplePropert(yourform,proprtyname) -- cast it to the required type.. ok, but i have a prepare action for the DynaValidatorForm where i initialize one bean, put it to the

Re: DynaValidatorForm - cannot find bean

2006-12-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Philippe, Pille wrote: how can i set a property of a dyna form from within an action? That's easy: just do the same thing you do in your SaveAction to get a reference to the form bean. Then, instead of just calling accessors to get the data our,

Re: DynaValidatorForm - cannot find bean

2006-12-18 Thread Pille
Christopher Schultz wrote: Philippe, Pille wrote: how can i set a property of a dyna form from within an action? That's easy: just do the same thing you do in your SaveAction to get a reference to the form bean. Then, instead of just calling accessors to get the data our, call mutators

S2 - Proper way interceptors to interact w/Session

2006-12-18 Thread Jon Wilmoth
I'm working on a custom S2 Interceptor and I'm not sure what the best way to interact with the session and/or other Interceptors for that matter is. First the session. I read http://struts.apache.org/2.x/docs/how-do-we-get-access-to-the-session.html and I tried applying the concept of using

Re: S2 - Proper way interceptors to interact w/Session

2006-12-18 Thread Don Brown
On 12/18/06, Jon Wilmoth [EMAIL PROTECTED] wrote: I'm working on a custom S2 Interceptor and I'm not sure what the best way to interact with the session and/or other Interceptors for that matter is. First the session. I read

S2 - Interceptors HTTP Response

2006-12-18 Thread Jon Wilmoth
Are there any rules the interceptors should be aware of when dealing with the HTTP response? I ask because I'm trying to save a cookie to the user's browser via an interceptor and although I'm adding the cookie (with a MaxAge attribute value = one year) to the response via

Send Post/Read Post

2006-12-18 Thread Robert Harrison
Hello, I posted a similar question in another forum a few weeks ago but didn't get an answer that worked. I'm posting information to an off-site server. That server posts back to me (key/value pairs). I need to read the posted pairs and choose a forward based on their values. I've tried two

Re: S2 - Proper way interceptors to interact w/Session

2006-12-18 Thread Jon Wilmoth
I'm fairly new to the S2 model and assumed the same IoC benefits applied to interceptors that apply to actions (i.e. my interceptor didn't need to know about a session if it was SessionAware). However, I might have been overjealous with the whole IoC concept. ;) I have changed my

Re: S2 - Proper way interceptors to interact w/Session

2006-12-18 Thread Don Brown
If it is only for a single request, I'd recommend using the ActionContext, e.g. ActionContext.getContext().put(key,value) Then, the servlet container won't try to serialize the objects between instances in a cluster. Don On 12/18/06, Jon Wilmoth [EMAIL PROTECTED] wrote: I'm fairly new to the

S2 v Stripes

2006-12-18 Thread Ron Chan
here's an interesting post about S2 http://www.oreillynet.com/onjava/blog/2006/12/struts_2_is_the_new_mini.html however it is being shot down in the comments by how much better Stripes is :( what say you to the statement Try stripes out for a couple of days, and then you'll be asking 'What does

Re: S2 v Stripes

2006-12-18 Thread Don Brown
Personally, I think it is the wrong question. What should be being asked is how can Struts 2 and Stripes work together more, or ideally, merge to create the better framework. We started Struts 2 with the idea of let's stop re-inventing the wheel. The idea of an Action-driven web framework has,

initialize a DynaValidatorForm property

2006-12-18 Thread Pille
hi, how can i initialize a property of type ArrayList in a DynaValidatorForm? i saw that i can do some simple initialization with the initial attribute in the form-peoperty tag in struts-config. at the moment i do some initialization in a prepare action that sets the attributes some combo boxes.

s:if in Struts2

2006-12-18 Thread red phoenix
I put a String into a session,and I use s:if to determine the session if it is exist,if exist,show OK,if not exist,it shows error,but when I run it,it shows error,I don't know why don't show OK? How to correct to show OK? my code is follows: %@ page contentType=text/html; charset=UTF-8 % %@

where to download 1.3.6 - broken link ?

2006-12-18 Thread Lixin Chu
the linked provided on WiKi seems broken: http://people.apache.org/builds/struts/1.3.6http://people.apache.org/builds/struts/1.3.6 are we going to have a new release soon ? thanks

bean:write in struts2

2006-12-18 Thread red phoenix
I want to change my code from struts1 to struts2,I use displaytag and bean:write to show following code,it can run well,bean:write name=element property=ID/ will show 1,2, %@ taglib uri=/struts-tags prefix=s % display:table name=testList export=false sort=external defaultsort=1 pagesize=2

Re: where to download 1.3.6 - broken link ?

2006-12-18 Thread Wendy Smoak
On 12/18/06, Lixin Chu [EMAIL PROTECTED] wrote: the linked provided on WiKi seems broken: http://people.apache.org/builds/struts/1.3.6http://people.apache.org/builds/struts/1.3.6 are we going to have a new release soon ? I changed the wiki to say will be available here since 1.3.6

RE: initialize a DynaValidatorForm property

2006-12-18 Thread mano dasanayake
Hi, Yes you can initiate an attribute of type arrayList in the DynaForm as follows, form-property name=yourList type=java.util.List / And in the action mapping specify the name of the Form Bean that you are about to use. In this case the form bean that contains the List you'r going to

Re: S2:The value of checkbox getted in server-side is false when no any checkbox been selected.

2006-12-18 Thread Denis Ling
Hi Dave Newton, Thanks for your reply quickly! please see my problem: generated HTML source segment by S2 ... input type=checkbox name=roleIds value=ROLE_ADMIN id=listRole_roleIds/ input type=hidden name=__checkbox_roleIds value=ROLE_ADMIN/ input type=checkbox name=roleIds

Re: initialize a DynaValidatorForm property

2006-12-18 Thread Pille
mano dasanayake wrote: Hi, Yes you can initiate an attribute of type arrayList in the DynaForm as follows, form-property name=yourList type=java.util.List / i know that. And in the action mapping specify the name of the Form Bean that you are about to use. In this case the form bean

where to download struts2.0 examples files?

2006-12-18 Thread red phoenix
In struts doc,I often see org.apache.struts2.example.*,I want to know where I can download the example fiels?