Author Login
Post Reply
user Digest 24 Jun 2008 13:09:07 -0000 Issue 8106
Topics (messages 188000 through 188029):
Re: validation and action names with slashes
188000 by: Roberto Nunnari
Re: Rest plugin and binary data
188001 by: Mike Watson
188024 by: Jeromy Evans
Newbie Q: How to set session object parameters in struts.xml
188002 by: John Smith
188004 by: Lukasz Lenart
188010 by: John Smith
188017 by: Dave Newton
188022 by: Lukasz Lenart
188023 by: Lukasz Lenart
[struts2] url tag not evaluating OGNL in anchor attribute
188003 by: Volker Krebs
Re: Closing tag for html:hidden
188005 by: Dimitris Mouchritsas
188006 by: Antonio Petrelli
188009 by: Dimitris Mouchritsas
188011 by: Antonio Petrelli
188012 by: Dimitris Mouchritsas
188013 by: Antonio Petrelli
188015 by: Dimitris Mouchritsas
188025 by: Antonio Petrelli
188027 by: Dimitris Mouchritsas
Re: Struts Themes Problem - help
188007 by: Narayana S
Performance of REST plug-in for struts2
188008 by: saharabear
Interceptor to access session objects
188014 by: John Smith
188018 by: Dave Newton
188019 by: John Smith
188020 by: stanlick.gmail.com
188026 by: Dave Newton
datetimepicker
188016 by: Gunnar.Bostrom.tietoenator.com
Character encoding for http request - Configuration for complete application
188021 by: Raghuveer
Re: validation notation on DATE (object that has a Date field)
188028 by: xianwinwin
Re: Struts2 Jar on JBoss
188029 by: Hernandez, David
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_188000.ezm (zipped)Jeromy Evans wrote:
> Roberto Nunnari wrote:
>> Jeromy Evans wrote:
>>> Roberto Nunnari wrote:
>>>
>>> This is what I intend to do. At the moment the CodeBehind/Convention
>>> plugin estimates the name of view candidates (eg.
>>> package-action-result.jsp)
>>> This change would just need to extend that to check if a tile exists
>>> with that name.
>>>
>>> This change will mean that @Result's are only required for the
>>> exceptional cases (those results that need to break the Tiles naming
>>> convention).
>>>
>>
>> Yes! That would be great!
>> Are you going to do the coding yourself?
>>
> Yes, it's on my todo list.
>
If I get round to, I may look into the code myself..
I'd be glad to contribute to struts.
--
Robi

Attachment:
user_188001.ezm (zipped)Hi Jeromy,
Please ignore my other email, I was being a dumb-ass.
Thanks heaps for the tips, I managed to get this working today.
Mike
2008/6/20 Jeromy Evans <jeromy.evans@(protected)>:
> Mike Watson wrote:
>>
>> Hi Folks,
>>
>> I'm trying to figure out how to return binary data from the REST plugin.
>>
>> I'd like to be able to return images that are generated on the fly by
>> a REST request but looking at ContentTypeHandlerManager, it assumes
>> that we'll only ever want to return a string and so passes a
>> StringWriter as the output for implementers of
>> ContentTypeHandler.fromObject.
>>
>>
>
> At first, don't create a custom ContentTypeHander.
> Just have your Controller declare a StreamResult. The default
> ContentTypeHandler will drop through for result processing by XWork (as per
> a ServletRedirectResult).
>
> eg. GET /namespace/image/21
>
> @Result("stream", type = StreamResult.class, value="image")
> class ImageController {
> public InputStream getImage() {}
>
> public String show() {
> // create the stream
> return "stream"; }
> }
>
> See StreamResult for how to set the Content-type and other properties.
>
> One that works, you could (potentially) register a ContentTypeHandler for
> each image content type you want to return (eg. register the jpg and png
> extensions). The ContentTypeHandler should do nothing except return a
> result name for XWork that is mapped to a StreamResult. The image retrieval
> would have to be performed in the Controller rather than the Handler though.
> There is probably a bit of work to do in the plugin to handle binary
> results better though.
>
> Hope that gets you started.
> Jeromy Evans
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188024.ezm (zipped)Mike Watson wrote:
> Hi Jeromy,
>
> Please ignore my other email, I was being a dumb-ass.
>
> Thanks heaps for the tips, I managed to get this working today.
>
> Mike
>
Good to hear. Sorry I hadn't got back to you.
regards,
Jeromy Evans

Attachment:
user_188002.ezm (zipped)Hello,
Is it possible to set session objects inside and action and access the
session object in another action without explicitly retrieving the
session object?
Thanks,
J

Attachment:
user_188004.ezm (zipped)Hi,
> Is it possible to set session objects inside and action and access the
> session object in another action without explicitly retrieving the
> session object?
Implement SessionAware interface with yours actions and put and get
value from that map ;-)
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_188010.ezm (zipped)I have implemented sessionAware and the process works for a static
string but it doesn't work for objects :(
So I have the following in my struts.xml:
<action name="blah"
class="blahAction">
<param name="parse">true</param>
<param name="test">hello</param>
<param name="something">${something}</param>
<result>out.jsp</result>
</action>
the "test" param works fine which is a simple string but the the other
param "something" does not work.
Does the syntax ${something} retrieve the object from the session?
On Tue, Jun 24, 2008 at 11:10 AM, Lukasz Lenart
<lukasz.lenart@(protected):
> Hi,
>
>> Is it possible to set session objects inside and action and access the
>> session object in another action without explicitly retrieving the
>> session object?
>
> Implement SessionAware interface with yours actions and put and get
> value from that map ;-)
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188017.ezm (zipped)--- On Tue, 6/24/08, John Smith <debrief@(protected):
> Does the syntax ${something} retrieve the object from the session?
No.
The previous answer, implementing SessionAware, was one of the correct answers.
Dave

Attachment:
user_188022.ezm (zipped)Hi,
I misunderstood you ;-) I spent some time to find solution but right
now it isn't possible because of StaticParametersInterceptor. Look at
the code below
for (Iterator iterator = parameters.entrySet().iterator();
iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
stack.setValue(entry.getKey().toString(),
entry.getValue()); // exception here if you try something like you
Object val = entry.getValue();
if (parse && val instanceof String) {
val = TextParseUtil.translateVariables((String)
val, stack); //
}
stack.setValue(entry.getKey().toString(), val); //
duplicated, it should be only once
}
In my opinion it should be changed to this, removed duplicated entry
for (Iterator iterator = parameters.entrySet().iterator();
iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
// it's duplicated
//stack.setValue(entry.getKey().toString(), entry.getValue());
Object val = entry.getValue();
if (parse && val instanceof String) {
val = TextParseUtil.translateVariables((String)
val, stack); //
}
stack.setValue(entry.getKey().toString(), val); //
duplicated, it should be only once
}
and one thing, you should put parse param on interceptor, not on action
<interceptor-ref name="staticParams">
<param name="parse">true</param>
</interceptor-ref>
<param name="cardNo">${params.myid}</param>
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_188023.ezm (zipped)To be clear with previous post, first try to parse data then put it on
the stack.
Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment:
user_188003.ezm (zipped)Hello,
I have the following in my JSP Page:
<a href='<s:url action="myAction" anchor="%{name}" />'>
It seems that the anchor attribute is not evaluating the OGNL.
I guess it's the same problem like this one:
https://issues.apache.org/struts/browse/WW-2015
or is there any reason for not evaluating OGNL ?
Thanks,
Volker

Attachment:
user_188005.ezm (zipped)Antonio Petrelli wrote:
> 2008/6/23 Dimitris Mouchritsas <dimitris.mouchritsas@(protected)>:
>> A tile definition. I've tried a few combinations, but none is working. For
>> example if I use
>>
>> <action
>> path="/home"
>> type="be.fedict.etendering.web.actions.common.HomeAction">
>> <forward name="home" path="home" redirect="true" />
>> </action>
>>
>> I get no exception but a blank page is returned.
>
> I suppose that Tiles has not been configured correctly then.
> See:
> http://wiki.apache.org/struts/StrutsUpgradeNotes12to13
>
> In particular, in the Tiles part:
>
> Add a chainConfig init-param in the web.xml pointing to the
> location of the chain-config.xml
>
> <init-param>
> <param-name>chainConfig</param-name>
> <param-value>org/apache/struts/tiles/chain-config.xml</param-value>
> </init-param>
>
> HTH
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
Still no luck. #*$&#$&!@(protected) :)
Anyway here's what I've done so far. Patch xdoclet 1.2.3 from
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
to allow xdoclet to create files for struts 1.3.
Updated commons-chain.jar to 1.2, commons-io.jar to 1.4. Added the
init-param you said. Even though no exception is seen in the logs,
I get a 500 Internal server error when trying to access the home page.
Here's my web.xml related part:
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>chainConfig</param-name>
<param-value>org/apache/struts/tiles/chain-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
...and here's the end of struts-config.xml:
<!-- Define your Struts controller in a file called
struts-controller.xml and place it in your merge directory. -->
<message-resources parameter="ApplicationResources" />
<message-resources parameter="ApplicationResourcesErrorMessages"
key="ERROR_RESOURCE_KEY" />
<message-resources parameter="ApplicationResourcesHelpMessages"
key="HELP_RESOURCE_KEY" />
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />
<set-property property="definitions-debug" value="1"/>
<set-property property="definitions-parser-validate" value="true" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-details" value="2"/>
</plug-in>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml"/>
<set-property property="stopOnFirstError" value="true" />
</plug-in>
</struts-config>
See anything wrong?
Regards
Dimitris

Attachment:
user_188006.ezm (zipped)2008/6/24 Dimitris Mouchritsas <dimitris.mouchritsas@(protected)>:
> I get a 500 Internal server error when trying to access the home page.
Can I see the stack trace?
Antonio

Attachment:
user_188009.ezm (zipped)Antonio Petrelli wrote:
> 2008/6/24 Dimitris Mouchritsas <dimitris.mouchritsas@(protected)>:
>
>> I get a 500 Internal server error when trying to access the home page.
>>
>
> Can I see the stack trace?
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
Hm, I think we're getting close. A colleague helped me. We had an
ErrorHandlerServlet which was
"eating" the exception. Now I get a meaningful 500:
500 Internal Server Error
OracleJSP: oracle.jsp.parse.JspParseException:
/WEB-INF/jsp/common/layout.jsp: Line # 2, <%@(protected)
uri="http://struts.apache.org/tags-tiles" prefix="t" %>
Error: Unable to load taghandler class: http://struts.apache.org/tags-tiles
Take a look at my changed layout.jsp:
<%@(protected)"%>
<%@(protected)" %>
<%@(protected)"%>
<%@(protected)"%>
<tiles:useAttribute name="title" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
.....
But why can't it find the tiles uri? I've included the
struts-tiles-1.3.8.jar.
Dimitris

Attachment:
user_188011.ezm (zipped)2008/6/24 Dimitris Mouchritsas <dimitris.mouchritsas@(protected)>:
> OracleJSP: oracle.jsp.parse.JspParseException:
> /WEB-INF/jsp/common/layout.jsp: Line # 2, <%@(protected)
> uri="http://struts.apache.org/tags-tiles" prefix="t" %>
> Error: Unable to load taghandler class: http://struts.apache.org/tags-tiles
> ...
> But why can't it find the tiles uri? I've included the
> struts-tiles-1.3.8.jar.
Probably it is a caching problem (in Tomcat happens when you change
libraries). Try cleaning up the work directory (I don't really know
where it is in OC4J, sorry).
Antonio

Attachment:
user_188012.ezm (zipped)Antonio Petrelli wrote:
> 2008/6/24 Dimitris Mouchritsas <dimitris.mouchritsas@(protected)>:
>
>> OracleJSP: oracle.jsp.parse.JspParseException:
>> /WEB-INF/jsp/common/layout.jsp: Line # 2, <%@(protected)
>> uri="http://struts.apache.org/tags-tiles" prefix="t" %>
>> Error: Unable to load taghandler class: http://struts.apache.org/tags-tiles
>> ...
>> But why can't it find the tiles uri? I've included the
>> struts-tiles-1.3.8.jar.
>>
>
> Probably it is a caching problem (in Tomcat happens when you change
> libraries). Try cleaning up the work directory (I don't really know
> where it is in OC4J, sorry).
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
So, since they're in the jars I don't need to declare the tld's in
web.xml right?
Dimitris

Attachment:
user_188013.ezm (zipped)2008/6/24 Dimitris Mouchritsas <dimitris.mouchritsas@(protected)>:
> So, since they're in the jars I don't need to declare the tld's in web.xml
> right?
Right, in fact I'm struggling to understand what is the problem, too :-D
Antonio

Attachment:
user_188015.ezm (zipped)Antonio Petrelli wrote:
> 2008/6/24 Dimitris Mouchritsas <dimitris.mouchritsas@(protected)>:
>
>> So, since they're in the jars I don't need to declare the tld's in web.xml
>> right?
>>
>
> Right, in fact I'm struggling to understand what is the problem, too :-D
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
Could it be that oc4j is not loading the tld's from the jars?
Dimitris

Attachment:
user_188025.ezm (zipped)2008/6/24 Dimitris Mouchritsas <dimitris.mouchritsas@(protected)>:
> Antonio Petrelli wrote:
>>
>> 2008/6/24 Dimitris Mouchritsas <dimitris.mouchritsas@(protected)>:
>>
>>>
>>> So, since they're in the jars I don't need to declare the tld's in
>>> web.xml
>>> right?
>>>
>>
>> Right, in fact I'm struggling to understand what is the problem, too :-D
>>
>> Antonio
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> Could it be that oc4j is not loading the tld's from the jars?
I don't think so, since you can use the other Struts tags
correctly.... or not? Check it out.
Antonio

Attachment:
user_188027.ezm (zipped)Well, one solution is to move the tld's to a directory and define them
in web.xml. This seems to be working.
However I've got some strange problems. For example in a tile I render a
link for advanced search:
<%@(protected)"%>
<%@(protected)"%>
<%--<bean:define id="currentDate" name="java.util.Date"
type="java.util.Date" />--%>
<jsp:useBean id="curDate" class="java.util.Date" />
<div id="Search">
<p class="Time">
<bean:message key="prompt.Greece" />
<bean:write name="curDate" format="HH:mm:ss zz" />
</p>
<form action="#">
<p>
<label for="SearchSelect"><bean:message key="prompt.search"
/>:</label>
<select name="SearchSelect" id="SearchSelect">
<option selected="selected">Select...</option></select>
<input type="text" name="SearchInput" id="SearchInput"
class="Text" />
<input type="submit" name="SearchBTN" id="SearchBTN"
class="SearchBTN" value="Search" />
<html:link action="prepareAdvancedSearch">
<bean:message key="prompt.advanced.search" />
</html:link>
<%--<a href="#">Advanced Search</a>--%>
</p>
</form>
</div><!-- Search -->
and I get
javax.servlet.jsp.JspException: ServletException in '/WEB-INF/jsp/common/search.jsp': null
at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:927)
at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)
at _web_2d_inf._jsp._common._layout._jspService(_layout.java:133)
[SRC:/WEB-INF/jsp/common/layout.jsp:80]
I know it's the link, because if I comment it out I get an exception on a different jsp and
the tile shows up.
I've also testet <bean:message> outside the link and it works.

Attachment:
user_188007.ezm (zipped)Hi laurie,
<s:form action="TestAction" method="post">
<s:label key="app.indexheader" />
<s:textfield name="cname" key="app.cname"/><br>
This is part of the form i am creating, when the theme is default the label
could get value app.indexheader from resource bundle and working fine, the
text fields also could generate a label with the values given for app.cname,
but when simple theme is given ( like <s:form action="TestAction"
method="post" theme="simple"> ) the label is not rendered!!
can you help me on solving this >?
On Mon, Jun 23, 2008 at 11:18 PM, Laurie Harper <laurie@(protected):
> Narayana S wrote:
>
>> Hi Dave,
>>
>> thanks for your reply, but when i use simple theme, my application is
>> not getting any values from resource bundle..
>>
>
> How is it failing? Note that the 'simple' theme generates a lot less
> markup, and doesn't generate everything the other themes do. Are I18N
> resources failing to get resolved, or is the theme just not generating the
> things you were expecting to see?
>
> will this problem be solved by extending theme ?
>>
>> can you provide any best link to extend a theme if it is the solution... ?
>>
>
> See the Themes and Templates documentation:
>
> http://struts.apache.org/2.0.11.1/docs/themes-and-templates.html
>
> L.
>
>
> On Sun, Jun 22, 2008 at 8:25 PM, Dave Newton <newton.dave@(protected)>
>> wrote:
>>
>> --- On Sun, 6/22/08, Narayana S <narayanasgs1@(protected):
>>>
>>>> The problem is here struts 2 is applying it's own styles to
>>>> my page, i want to give my own styles instead of using struts
>>>> default styles,
>>>>
>>> The easiest answer is to just supply your own CSS styles. You can also
>>> extend an existing, or create your own, theme.
>>>
>>> Dave
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188008.ezm (zipped)Hi, Mike:
I am new to this mail list and I can not find the archive of your mails
about REST plug-in for struts2. I just want to confirm about the
performance of the plug-in, does it works well for real commercial
project? Do you have anything about the performance and stable?
Thanks a lot.
Haolin

Attachment:
user_188014.ezm (zipped)Hello,
Which interceptor can I use to access session objects by putting them
as paramteres in struts.xml?
Many thanks,
J

Attachment:
user_188018.ezm (zipped)--- On Tue, 6/24/08, John Smith <debrief@(protected):
> Which interceptor can I use to access session objects by
> putting them as parameters in struts.xml?
What, specifically, are you trying to accomplish?
Dave

Attachment:
user_188019.ezm (zipped)On Tue, Jun 24, 2008 at 1:12 PM, Dave Newton <newton.dave@(protected):
> --- On Tue, 6/24/08, John Smith <debrief@(protected):
>> Which interceptor can I use to access session objects by
>> putting them as parameters in struts.xml?
>
> What, specifically, are you trying to accomplish?
Basically I add objectXYZ to the session in actionA then the user
submits a query to ActionB. I want to retrieve objectXYZ from the
session without directly calling the a method on the session object
inside actionB in order to retrieve objectXYZ.
I looked at staticParameters and I can retrieve static param strings
set in struts.xml by only having getter and setter methods in an
action so I wanted to do something similar with dynamicly created
objects and referencing them in struts.xml
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_188020.ezm (zipped)Take a look at the Scoped Model Driven
Interceptor<http://struts.apache.org/2.x/docs/scoped-model-driven-interceptor.html>
Scott
On Tue, Jun 24, 2008 at 6:32 AM, John Smith <debrief@(protected):
> On Tue, Jun 24, 2008 at 1:12 PM, Dave Newton <newton.dave@(protected)>
> wrote:
> > --- On Tue, 6/24/08, John Smith <debrief@(protected):
> >> Which interceptor can I use to access session objects by
> >> putting them as parameters in struts.xml?
> >
> > What, specifically, are you trying to accomplish?
>
> Basically I add objectXYZ to the session in actionA then the user
> submits a query to ActionB. I want to retrieve objectXYZ from the
> session without directly calling the a method on the session object
> inside actionB in order to retrieve objectXYZ.
>
> I looked at staticParameters and I can retrieve static param strings
> set in struts.xml by only having getter and setter methods in an
> action so I wanted to do something similar with dynamicly created
> objects and referencing them in struts.xml
>
>
> > Dave
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
Scott
stanlick@(protected)

Attachment:
user_188026.ezm (zipped)--- On Tue, 6/24/08, John Smith <debrief@(protected):
> Basically I add objectXYZ to the session in actionA then
> the user submits a query to ActionB. I want to retrieve
> objectXYZ from the session without directly calling the
> a method on the session object inside actionB in order
> to retrieve objectXYZ.
I found the last sentence difficult to parse.
What's your objection to ActionB retrieving the object via SessionAware (or through ActionContext)?
Dave

Attachment:
user_188016.ezm (zipped)Hi,
I'm trying to use the struts2 datetimepicker and it works fine except
when I input an invalid date with the keyboard.
When doing this for struts 2.0.11.1 it resets the date to the value it
had before without any notice!
When doing it for struts 2.1.2 it sets the date to 1970-01-01 without
any notice!
I would like to get an error message and that the input stays with an
invalid date.
Is this possible?
/Gunnar

Attachment:
user_188021.ezm (zipped)I am working on I18N application.
To handle Http request and response in utf8 I have added following code in
my Actionform.
Is there way in struts to configure this for my complete application in
struts?
If it is normal servlet we can do this in init() method.
public void reset(ActionMapping mapping, HttpServletRequest request) {
super.reset(mapping, request);
//To reset all input fields
try {
request.setCharacterEncoding("UTF-8");
}
catch (UnsupportedEncodingException ex) {
}
}// end of reset()

Attachment:
user_188028.ezm (zipped)
hi Lukasz
In your example, you wrote:
Private Date today;
@RequiredFieldValidator(message = "Date is required")
public Date getToday() {
return today;
}
this works great also in my application, but my question is different, I
don't have a field called today, I have an object name Empl (that has a
field date)
so I have:
public Empl getEmpl()
{
}
in my action: insertEmpl()
I would like to make sure that DOB (Date Of Birth) was input by the user.
This, I still didn't figure out how to do.
The configuration that I have is this:
@Validations(
stringLengthFields ={
@StringLengthFieldValidator(type = ValidatorType.SIMPLE, trim = true,
minLength="1" , fieldName = "empl.name", message = "required field")
}
)
public String insertEmpl()
{
//do something here only if both DOB and NAME are not null (or size
0)
}
Lukasz Lenart wrote:
>
> Hi,
>
>> This also works on my end *BUT* the Date in part of an Object (not a
>> field)
>
> Could you show your configuration?
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_188029.ezm (zipped)So does anyone know how to get JBoss to look inside the jar (which isn't
in WEB-INF/lib, but the JBoss Server lib) for the struts tld?
David Hernandez
-----Original Message-----
From: Musachy Barroso [mailto:musachy@(protected)]
Sent: Monday, June 23, 2008 5:50 PM
To: Struts Users Mailing List
Subject: Re: Struts2 Jar on JBoss
Yes, that's what I meant, but not what I said, that happens when there
is too much multitasking going on :)
musachy
On Mon, Jun 23, 2008 at 5:47 PM, Hernandez, David
<david.hernandez@(protected):
> That's not the case. If the jar isn't present then the deployment
fails upon reading struts.xml because the FilterDispatcher cannot be
found. The classes are being loaded from the jar however it's not
looking in the jar for the TLD.
> Regards,
> ------Original Message------
> From: Musachy Barroso
> To: Struts Users Mailing List
> ReplyTo: Struts Users Mailing List
> Sent: Jun 23, 2008 5:32 PM
> Subject: Re: Struts2 Jar on JBoss
>
> The taglib is in core, so somehow it is not finding struts-core jar.
>
> musachy
>
> On Mon, Jun 23, 2008 at 5:15 PM, Hernandez, David
> <david.hernandez@(protected):
>> Hey Guys,
>>
>> I'm trying to deploy several apps built with Struts2 that share a
>> common lib directory. I'm running on JBoss. If I put all the jar's in
>> the server lib directory everything compiles and deploys fine. If I
>> go to an action it is executed, but when it attempts to read the jsp
>> it fails to find the struts tld. See an excerpt from my log below:
>>
>> ....
>> 2008-06-23 17:12:49,085 DEBUG
>> [com.opensymphony.xwork2.util.InstantiatingNullHandler] Entering
>> nullPropertyValue
>> [target=[com.lehman.corpsec.web.UpdateDailyCheckoutStatusXMLServlet@(protected)
>> 50b 99d, com.opensymphony.xwork2.DefaultTextProvider@(protected)],
>> property=org]
>> 2008-06-23 17:12:49,280 DEBUG
>> [org.jboss.web.tomcat.service.jasper.TagLibCache] Scanning for tlds
in:
>> file:/home/nycco2q/jboss/eap4.2/deploy/jboss-web.deployer/jsf-libs/js
>> f-i
>> mpl.jar
>> 2008-06-23 17:12:49,420 DEBUG
>> [org.jboss.web.tomcat.service.jasper.TagLibCache] Scanning for tlds
in:
>> file:/home/nycco2q/jboss/eap4.2/deploy/jboss-web.deployer/jstl.jar
>> 2008-06-23 17:12:49,513 ERROR
>> [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/CO2
>> /Da ilyCheckout].[jsp]] Servlet.service() for servlet jsp threw
>> exception
>> org.apache.jasper.JasperException: File "/struts-tags" not found
>> at
>> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorH
>> and
>
> ------Original Message Truncated------
>
> David Hernandez
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - - - -
>
> This message is intended only for the personal and confidential use of
the designated recipient(s) named above. If you are not the intended
recipient of this message you are hereby notified that any review,
dissemination, distribution or copying of this message is strictly
prohibited. This communication is for information purposes only and
should not be regarded as an offer to sell or as a solicitation of an
offer to buy any financial product, an official confirmation of any
transaction, or as an official statement of Lehman Brothers. Email
transmission cannot be guaranteed to be secure or error-free.
Therefore, we do not represent that this information is complete or
accurate and it should not be relied upon as such. All information is
subject to change without notice.
>
>
> --------
> IRS Circular 230 Disclosure:
> Please be advised that any discussion of U.S. tax matters contained
within this communication (including any attachments) is not intended or
written to be used and cannot be used for the purpose of (i) avoiding
U.S. tax related penalties or (ii) promoting, marketing or recommending
to another party any transaction or matter addressed herein.
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.
--------
IRS Circular 230 Disclosure:
Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein.