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.
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
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
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
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,
*
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
*
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
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
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
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;
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
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
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:
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
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
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
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
-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
-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 =
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,
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
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
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
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
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
-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,
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
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
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
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
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
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
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
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
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,
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.
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 %
%@
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
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
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
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
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
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
In struts doc,I often see org.apache.struts2.example.*,I want to know
where I can download the example fiels?
44 matches
Mail list logo