Forward to different JSPs

2007-08-15 Thread JasDA
Hi,

in my web application I want to call one single action class from different 
JSPs. After that the class should return to the JSP from that it was called. In 
my struts action tags I have to define an input JSP for every action:

   

So here it is only possible to return to the given input JSP "dataChecks.jsp". 
How can I return to the calling JSP without defining one action tag for every 
single JSP?

Regards,
Christoph
__
Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach!

Mehr Infos unter http://produkte.web.de/club/?mc=021131


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problems with multiple resource files (can separate modules be a solution?)

2007-08-15 Thread struts
Hi,

I just noticed that we have a problem with our resource files for our site. The
problem is that I don't know how to handle more then one resource file.

We have two different parts of the site that both use resource properties. One
of them (a forum) is build by other persons in our projekt. The other one (a
place where the user can login and purchase things, for instance) is done by
me.
During development I never bothered to create my resource properties file, so
all errors got printed like "??the_error_message_key??". But then I created a
resource file, and then the problems started.

With more then one resource, it seems that I need to specify which one to use.
Is there no way to make it use both? Ie it first looks in one, and then the
other, and so on, until it finds what it is looking for.
I don't want to have to use bundle="some-name" all over the place.

And don't want to have to make the forum guys make changes in their code if not
absolutely necessary.

After searching on google, I'm starting to think that maybe one option is to
divide this into two different struts modules. But it seems like a lot of work,
and even though I have read the struts userguide on modules I still don't
understand exactly how it works. And is it even possible to "move" out the
forum part to a own module withouth changing code in jsp-pages and stuff?

Does anything I wrote here make any sense to you guys? I'm sure I'm going at
this the wrong way, but I don't know what I should do...

All I want is to be able to display messages (mostly errors), have multiple
resource files, and not have to use the bundle attribute.

One solution that I know will work is to put all properties in one big file, but
I really don't like that idea.

Suggestions?

Regards
/Jimi

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 1.2 using formbeans

2007-08-15 Thread Jasper Floor
hmm, I assume the input fields have the same name as the relevant form
properties. Case is important.  Perhaps you need an input parameter in
your action definition. input=inputform.jsp or something along those
lines.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Forward to different JSPs

2007-08-15 Thread Jasper Floor
On 8/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,
>
>path="/secure/dataChecks"
>   name="emptyForm"
>   type="org.springframework.web.struts.DelegatingActionProxy"
>   input="/secure/dataChecks.jsp" />
>
> So here it is only possible to return to the given input JSP 
> "dataChecks.jsp". How can I return to the calling JSP without defining one 
> action tag for every single JSP?

If you don't close your actionmapping right away you can put 
tags in which you can define diffrent places to go.


   


In your action class you can look for request params to decde which way to go.

http://struts.apache.org/1.3.8/userGuide/building_controller.html#config

for more info.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts2 ajax jsps

2007-08-15 Thread Struts2 Fan

It worked when I change the extention to "action". I am using Appfuse and it
comes with "html" extention default. So I wonder if there is a way to make
it work with "html" extention or I will post a message to Appfuse if it is
possible to change the default extention to something else than "html".

Thanks...  


Ian Roughley wrote:
> 
> This line:
> 
> There is no Action mapped for namespace /struts/dojo/src/widget/templates
> and action name TabContainer. 
> 
> Seems to suggest that you may have changed the extension from ".action" 
> to ".html", so s2 is looking for an action called TabContainer.
> 
> /Ian
> Struts2 Fan wrote:
>> I met the same error, too.
>>
>> I have just a simple jsp
>>
>>  start of simple.jsp 
>> <%@ include file="/common/taglibs.jsp" %>
>> 
>> 
>> 
>> 
>> 
>> 
>>   
>> 
>> 
>> 
>> 
>> This is the right pane
>> 
>> 
>>  end of simple.jsp 
>>
>> Here it gives the following error
>>
>>  start of error 
>>  ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find action
>> or
>> result
>> There is no Action mapped for namespace /struts/dojo/src/widget/templates
>> and action name TabContainer. - [unknown location]
>>  at
>> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
>>  at
>> org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
>>  at
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
>>  at
>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
>>  at
>> org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106)
>>  at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
>>  at
>> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
>>  at
>> org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
>>  at
>> org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
>>  at
>> org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
>>  at
>> net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75)
>>  at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
>>  at
>> org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64)
>>  at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
>>  at
>> com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
>>  at
>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
>>  at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
>>  at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
>>  at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
>>  at
>> org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
>>  at
>> org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
>>  at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>  at
>> org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
>>  at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>  at
>> org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
>>  at
>> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>  at
>> org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
>>  at
>>

Re: Struts 2 URL parameters lost - final status

2007-08-15 Thread rakeshxp

I am using Struts 2.0.6 and the jar contains struts struts-default.xml which
contains the following property 





We have a struts.xml in WEB-INF/classes folder and I was trying to override
the default actionmapper by having the following lines in my struts.xml (
just for testing I am overriding with the default class itself )


But this results in an error when I started up tomcat
Unable to load bean: type:org.apache.struts2.dispatcher.mapper.ActionMapper
class:org.apache.struts2.dispatcher.mapper.DefaultActionMapper - bean -
file:/C:/software/tomcat6/webapps/abc/WEB-INF/classes/struts.xml:17:149

Caused by: Bean type interface
org.apache.struts2.dispatcher.mapper.ActionMapper with the name struts has
already been loaded by [unknown location] - bean -
file:/C:/software/tomcat6/webapps/abc/WEB-INF/classes/struts.xml:17:149

So the question that I have are 
1) How do I override the mapping class ?
2) Why are there 4 bean declaration for actionmapper ? 

thanks in advance!



JBL wrote:
> 
> Final answer: we implemented a custom ActionMapper that handles a URL
> string that doesn't involve a ? to separate the query parameters. Stuck a
> reference to it in struts.properties:
> 
> struts.mapper.class=mypackage.MyActionMapper
> 
> Building a new ActionMapper isn't terribly difficult. It helps to define
> your expected URLs with a regular expression, then use a precompiled
> pattern. Ours looks something like:
> 
> private static String NAMESPACE_REGEX = "...";
> private static String ACTION_REGEX = "...";
> private static String METHOD_REGEX = "...";
> private static String PARAMS_REGEX = "...";
> 
> private static String URI_REGEX = (concatenate the four above)
> 
> private static Pattern URI_PATTERN = Pattern.compile(URI_REGEX);
> 
> Then, in getMapping(), pull out the URI (similar to DefaultActionMapper)
> and call
> 
> Matcher m = URI_PATTERN.matcher(uri);
> 
> If you get a match, create a new ActionMapping and set its components
> based on the matching groups:
> 
> mapping.setNamespace(m.group(1));
> mapping.setName(m.group(1));
> 
> etc.
> 
> You can parse the parameter section and build a map to pass to
> mapping.setParams().
> 
> Using a precompiled pattern may or may not be the most efficient possible
> solution, but it helps you define exactly what URIs you expect. I
> recommend throwing a bunch of possibilities at it in your unit test code
> with various components present and missing. If you're a little unsure
> about regular expressions, build some unit tests for those, too. Sun has a
> decent write-up in their Java documentation:
> 
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html
> 
> Especially read the "Groups and Capturing" section, it's a handy tool to
> have in your portfolio.
> 
> We may yet discover why we couldn't get query parameters, but this works
> for now. Good luck.
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-URL-parameters-lost-tf4196254.html#a12160600
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



S2 : Overriding interceptor class names in struts.xml

2007-08-15 Thread j alex
Hi,

Is there a way we can override the implementation of certain
interceptors from the default stack, without copying over all the
definitions to struts.xml ?

ex : i want to change the behavior of workflow interceptor in the way
it handles errors and routes to input page. I defined :

 

 

within 

in struts.xml, but seems it still picks up the default one.

I know we can override the params of each interceptor , but can we do
the same with implementation class itself?

Thanks,
Joseph

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2 : Overriding interceptor class names in struts.xml

2007-08-15 Thread Nils-Helge Garli
Unfortunately, you have to re-define the stack.

Nils-H

On 8/15/07, j alex <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there a way we can override the implementation of certain
> interceptors from the default stack, without copying over all the
> definitions to struts.xml ?
>
> ex : i want to change the behavior of workflow interceptor in the way
> it handles errors and routes to input page. I defined :
>
>  
>  class="com.mypackage.MyWorkflowInterce
> ptor"/>
>  
>
> within 
>
> in struts.xml, but seems it still picks up the default one.
>
> I know we can override the params of each interceptor , but can we do
> the same with implementation class itself?
>
> Thanks,
> Joseph
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Trouble getting to portlet render phase

2007-08-15 Thread Frederick N. Brier
I am pretty sure this is a configuration issue, probably in struts.xml.  
I am trying to create a JSR168 compliant portlet.  I have been working 
with the portletunit code to get it to execute in a unit test, as well 
as running it with JBossPortal.  The behavior is the same, so I am 
hoping it is not an issue of the test harness introducing an issue.  I 
debug/traced the execution.  The Action is correctly constructed using 
the SpringFactory along with all properties.  It is invoked and executes 
without error.  It gets to DefaultActionInvocation having created a 
PortletResult, and calls result.execute(this).  The lastFinalLocation is 
set to the location of the jsp specified in the struts.xml. 
PortletResult.doExecute() calls executeRegularServletResult().


Should I have been in render mode at this point and had 
executeRenderResult called instead?  I have seen a number of posting 
saying "best practice" is to redirect to another action executing in 
render phase that then specifies the jsp as the result.  Mine ends up 
calling PreparatorServlet.service and sets up the servlet request 
parameters into the ActionContext, and then ends, having never called 
the jsp.  I also am not seeing where the Jsr168Dispatcher is ever 
invoked.  It does not show up in the stack as I execute.  I do not know 
if that is an issue.


I have tried a number of combinations of XML including trying to 
redirect to a "renderDirect.action" which then redirects to the .jsp.  
Problem is that I have found no examples of using this action, and I 
have not stumbled on the answer.  I have tried setting the result type 
to redirect... no joy.  I am using Struts 2.0.9.  If anyone could take a 
peek at my struts.xml and tell me what I am doing wrong, I would be 
eternally grateful.  I do not understand how my code differs from the 
HelloWorld portlet examples that I started with.  Thank you.


Fred

--struts.xml---

http://struts.apache.org/dtds/struts-2.0.dtd";>


   
 
  

 




 
 
  

  
 
/WEB-INF/view/MyPortlet.jsp
 
 
/WEB-INF/view/MyPortlet.jsp
 
 
name="success">/WEB-INF/view/MyPortletSubcomponent1.jsp

 
  

  
 
/WEB-INF/edit/index.jsp
 
  

  
 
/WEB-INF/help/index.jsp
 
  

--applicationContext.xml---
...
 scope="prototype" autowire="byName">

   ...
 
...
--portlet.xml
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd 
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"; id="struts-portlet">

 
A Sample Portlet
MySamplePortlet
Sample Portlet


org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher


   
   

   viewNamespace
   /view
   
   
   
   defaultViewAction
   index
   
   
   

   editNamespace
   /edit
   
   
   
   defaultEditAction
   index
   
   
   

   helpNamespace
   /help
   
   
   
   defaultHelpAction
   index
   
  
   0


   
 text/html
 edit
 help
   

   en


   Sample Portlet
   Sample View Portlet
   Sample View

 

--web.xml

2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>


   
   
   contextConfigLocation
   /WEB-INF/applicationContext.xml
   
   
   action2
   
   org.apache.struts2.dispatcher.FilterDispatcher
   
   

   
   action2
   /*
   
  
   

   
   org.springframework.web.context.ContextLoaderListener
   
   
   
   
   org.apache.struts2.portlet.context.ServletContextHolderListener
   
   

   
   preparator
   
   org.apache.struts2.portlet.context.PreparatorServlet
   
   
   
   dwr
   uk.ltd.getahead.dwr.DWRServlet
   

  
 preparator
 /*
  

   
   dwr
   /dwr/*
   




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to find validation.js?

2007-08-15 Thread Joel Patton

Thanks -I figured it out.

In my web.xml I had only mapped the struts FilterDispatcher to  
*.action, I had to change it to map it to /*.


My old web.xml:

struts2
class>org.apache.struts2.dispatcher.FilterDispatcher




struts2
*.action



New, correct web.xml:

struts2
class>org.apache.struts2.dispatcher.FilterDispatcher




struts2
/*




On Aug 14, 2007, at 11:31 PM, Musachy Barroso wrote:


The file is there(inside the Struts jar file). You don't need to
extract the file, S2 will serve it from inside the jar. If you put the
url by hand on the browser, does it return the js file?

musachy

On 8/14/07, Joel Patton <[EMAIL PROTECTED]> wrote:

I am trying to get the client side validation working in my Struts 2
app using the xhtml theme, but my web page isn't loading
validation.js. I see the outputted HTML as:



Do I need to copy the template directories out of the struts2-core
jar file into my web content path or should this be loading the JS
directly from the jar file? I didn't see any instructions about
moving files out of the jar, so I'm confused how my app is supposed
to be able to resolve this reference to validation.js when I don't
have a struts/..etc path underneath my web root. Is there a
configuration setting I'm missing somewhere?

Thanks,

Joel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
"Hey you! Would you help me to carry the stone?" Pink Floyd

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Re: Trouble getting to portlet render phase

2007-08-15 Thread Nils-Helge Garli
Are you creating the urls correctly using the s:url tag? Do you have
an example JSP? How do you invoke your portlet application? Remember
that you can't access the portlet using regular urls, they all have to
go through the portlet container.

Nils-H

On 8/15/07, Frederick N. Brier <[EMAIL PROTECTED]> wrote:
> I am pretty sure this is a configuration issue, probably in struts.xml.
> I am trying to create a JSR168 compliant portlet.  I have been working
> with the portletunit code to get it to execute in a unit test, as well
> as running it with JBossPortal.  The behavior is the same, so I am
> hoping it is not an issue of the test harness introducing an issue.  I
> debug/traced the execution.  The Action is correctly constructed using
> the SpringFactory along with all properties.  It is invoked and executes
> without error.  It gets to DefaultActionInvocation having created a
> PortletResult, and calls result.execute(this).  The lastFinalLocation is
> set to the location of the jsp specified in the struts.xml.
> PortletResult.doExecute() calls executeRegularServletResult().
>
> Should I have been in render mode at this point and had
> executeRenderResult called instead?  I have seen a number of posting
> saying "best practice" is to redirect to another action executing in
> render phase that then specifies the jsp as the result.  Mine ends up
> calling PreparatorServlet.service and sets up the servlet request
> parameters into the ActionContext, and then ends, having never called
> the jsp.  I also am not seeing where the Jsr168Dispatcher is ever
> invoked.  It does not show up in the stack as I execute.  I do not know
> if that is an issue.
>
> I have tried a number of combinations of XML including trying to
> redirect to a "renderDirect.action" which then redirects to the .jsp.
> Problem is that I have found no examples of using this action, and I
> have not stumbled on the answer.  I have tried setting the result type
> to redirect... no joy.  I am using Struts 2.0.9.  If anyone could take a
> peek at my struts.xml and tell me what I am doing wrong, I would be
> eternally grateful.  I do not understand how my code differs from the
> HelloWorld portlet examples that I started with.  Thank you.
>
> Fred
>
> --struts.xml---
> 
>  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd";>
>
> 
> 
>
>
>   
>  
>  
>  
>  
>   
>   
>
>
>
>   
>  /WEB-INF/view/MyPortlet.jsp
>   
>   
>  /WEB-INF/view/MyPortlet.jsp
>   
>   
>   name="success">/WEB-INF/view/MyPortletSubcomponent1.jsp
>   
>
>
>
>   
>  /WEB-INF/edit/index.jsp
>   
>
>
>
>   
>  /WEB-INF/help/index.jsp
>   
>
> 
> --applicationContext.xml---
> ...
>scope="prototype" autowire="byName">
> ...
>   
> ...
> --portlet.xml
>  xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
> http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"; id="struts-portlet">
>   
>  A Sample Portlet
>  MySamplePortlet
>  Sample Portlet
>
>
> org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher
>
> 
> 
> viewNamespace
> /view
> 
> 
> 
> defaultViewAction
> index
> 
> 
> 
> editNamespace
> /edit
> 
> 
> 
> defaultEditAction
> index
> 
> 
> 
> helpNamespace
> /help
> 
> 
> 
> defaultHelpAction
> index
> 
>
> 0
>
> 
>   text/html
>   edit
>   help
> 
>
> en
>
>  
> Sample Portlet
> Sample View Portlet
> Sample View
>  
>   
> 
> --web.xml
> 
>  2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd";>
> 
> 
> 
> contextConfigLocation
> /WEB-INF/applicationContext.xml
> 
> 
> action2
> 
> org.apache.struts2.dispatcher.FilterDispatcher
> 
> 
>
> 
> action2
> /*
> 
>
> 
> 
> org.springframework.web.context.ContextLoaderListener
> 
> 
> 
> 
> org.apache.struts2.portlet.context.ServletContextHolderListener
> 
> 
>
> 
> preparator
> 
> org.apache.struts2.portlet.context.PreparatorServlet
> 
> 
> 
> dwr
> uk.ltd.getahead.dwr.DWRServlet
> 
>
>
>   preparator
>   /*
>
>
> 
> dw

Re: Dynamic Tree Example

2007-08-15 Thread Roger Varley
>
> What I would really like to do is create a model Petshop application
> for Struts 2. I've setup a Google Code site for this purpose, but I
> haven't had a chance to seriously pursue it yet.
>
>  * http://code.google.com/p/sq1-petstore/
>
> My dream would be to have a full set of use cases, a reasonable set of
> formal requirements, and full suite of  JUnit and Selenium tests for
> Petstore, along the lines of what I do for my own projects.
>

Would there be merit in suggesting that maybe we should have two seperate 
versions. One "traditional" implementation - minimal javascript, no ajax etc 
and a second version using the full gamut of available technologies.

Regards
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: struts2 ajax jsps

2007-08-15 Thread Ian Roughley
I think there was a discussion from Matt about this (appfuse using html 
extensions) a while back, you might want to check the archives.  On the 
s2 side, there are options, but I'm not sure there is an easy solution 
for using .html as an extension.


/Ian

Struts2 Fan wrote:

Opps How can I make struts to ignore this and read them as html? Or do I
have to change the extention to get it work.

Thanks for the answer.


Ian Roughley wrote:
  

This line:

There is no Action mapped for namespace /struts/dojo/src/widget/templates
and action name TabContainer. 

Seems to suggest that you may have changed the extension from ".action" 
to ".html", so s2 is looking for an action called TabContainer.


/Ian
Struts2 Fan wrote:


I met the same error, too.

I have just a simple jsp

 start of simple.jsp 
<%@ include file="/common/taglibs.jsp" %>






  




This is the right pane


 end of simple.jsp 

Here it gives the following error

 start of error 
 ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find action
or
result
There is no Action mapped for namespace /struts/dojo/src/widget/templates
and action name TabContainer. - [unknown location]
at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75)
at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274

2.0.9 UnknownClassVersionError

2007-08-15 Thread Hartrich, James CTR USTRANSCOM J6
I'm getting an UnknownClassVersion error during struts2.0.9 deployment
to tomcat with java 1.5.0.0.3 

Is struts 2.0.9 entirely compiled in java 6?

 

James Hartrich

 



Re: struts2 ajax jsps

2007-08-15 Thread Struts2 Fan

I know that discussion but it "html" extention locks some of the
functionality of struts2, it would be better to change it from "html" to
something else. If you say *it is not easy*, at least I will post a message
on the appfuse forum. 


Ian Roughley wrote:
> 
> I think there was a discussion from Matt about this (appfuse using html 
> extensions) a while back, you might want to check the archives.  On the 
> s2 side, there are options, but I'm not sure there is an easy solution 
> for using .html as an extension.
> 
> /Ian
> 
> Struts2 Fan wrote:
>> Opps How can I make struts to ignore this and read them as html? Or
>> do I
>> have to change the extention to get it work.
>>
>> Thanks for the answer.
>>
>>
>> Ian Roughley wrote:
>>   
>>> This line:
>>>
>>> There is no Action mapped for namespace
>>> /struts/dojo/src/widget/templates
>>> and action name TabContainer. 
>>>
>>> Seems to suggest that you may have changed the extension from ".action" 
>>> to ".html", so s2 is looking for an action called TabContainer.
>>>
>>> /Ian
>>> Struts2 Fan wrote:
>>> 
 I met the same error, too.

 I have just a simple jsp

  start of simple.jsp 
 <%@ include file="/common/taglibs.jsp" %>
 
 
 
 
 
 
   
 
 
 
 
 This is the right pane
 
 
  end of simple.jsp 

 Here it gives the following error

  start of error 
  ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find
 action
 or
 result
 There is no Action mapped for namespace
 /struts/dojo/src/widget/templates
 and action name TabContainer. - [unknown location]
at
 com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at
 org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at
 org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
at
 org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
 org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106)
at
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
 com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
 org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
 org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
 org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
 net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75)
at
 net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
 org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64)
at
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
 com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
 org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
at
 org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at
 org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at
 org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
>>>

Re: Trouble getting to portlet render phase

2007-08-15 Thread Frederick N. Brier
In my portletunit test, I am using a url of 
"view/viewMyPortlet.action".  In JBossPortal, I create a Portlet 
Instance from the Portlet Definition and then under the Portlet Objects 
tab assign it to a region in the page layout.  Is there somewhere I 
would specify a URL?  And what would it be?  What URL would you suggest 
I specify in portletunit?  That would be helpful as I am trying to use 
that as a test harness and avoid launching a container.  Thank you!!


Fred

Nils-Helge Garli wrote:

Are you creating the urls correctly using the s:url tag? Do you have
an example JSP? How do you invoke your portlet application? Remember
that you can't access the portlet using regular urls, they all have to
go through the portlet container.

Nils-H

On 8/15/07, Frederick N. Brier <[EMAIL PROTECTED]> wrote:
  

I am pretty sure this is a configuration issue, probably in struts.xml.
I am trying to create a JSR168 compliant portlet.  I have been working
with the portletunit code to get it to execute in a unit test, as well
as running it with JBossPortal.  The behavior is the same, so I am
hoping it is not an issue of the test harness introducing an issue.  I
debug/traced the execution.  The Action is correctly constructed using
the SpringFactory along with all properties.  It is invoked and executes
without error.  It gets to DefaultActionInvocation having created a
PortletResult, and calls result.execute(this).  The lastFinalLocation is
set to the location of the jsp specified in the struts.xml.
PortletResult.doExecute() calls executeRegularServletResult().

Should I have been in render mode at this point and had
executeRenderResult called instead?  I have seen a number of posting
saying "best practice" is to redirect to another action executing in
render phase that then specifies the jsp as the result.  Mine ends up
calling PreparatorServlet.service and sets up the servlet request
parameters into the ActionContext, and then ends, having never called
the jsp.  I also am not seeing where the Jsr168Dispatcher is ever
invoked.  It does not show up in the stack as I execute.  I do not know
if that is an issue.

I have tried a number of combinations of XML including trying to
redirect to a "renderDirect.action" which then redirects to the .jsp.
Problem is that I have found no examples of using this action, and I
have not stumbled on the answer.  I have tried setting the result type
to redirect... no joy.  I am using Struts 2.0.9.  If anyone could take a
peek at my struts.xml and tell me what I am doing wrong, I would be
eternally grateful.  I do not understand how my code differs from the
HelloWorld portlet examples that I started with.  Thank you.

Fred

--struts.xml---

http://struts.apache.org/dtds/struts-2.0.dtd";>




   
  
 
 
 
 
  
  
   

   
  
 /WEB-INF/view/MyPortlet.jsp
  
  
 /WEB-INF/view/MyPortlet.jsp
  
  
 /WEB-INF/view/MyPortletSubcomponent1.jsp
  
   

   
  
 /WEB-INF/edit/index.jsp
  
   

   
  
 /WEB-INF/help/index.jsp
  
   

--applicationContext.xml---
...
  
...
  
...
--portlet.xml
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"; id="struts-portlet">
  
 A Sample Portlet
 MySamplePortlet
 Sample Portlet


org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher



viewNamespace
/view



defaultViewAction
index



editNamespace
/edit



defaultEditAction
index



helpNamespace
/help



defaultHelpAction
index


0


  text/html
  edit
  help


en

 
Sample Portlet
Sample View Portlet
Sample View
 
  

--web.xml

http://java.sun.com/dtd/web-app_2_3.dtd";>



contextConfigLocation
/WEB-INF/applicationContext.xml


action2

org.apache.struts2.dispatcher.FilterDispatcher




action2
/*




org.springframework.web.context.ContextLoaderListener




org.apache.struts2.portlet.context.ServletContextHolderListener




preparator

org.apache.struts2.portlet.context.PreparatorServlet



dwr
uk.ltd.getahead.dwr.DWRServlet


   
  preparator
  /*
   


dwr
 

Struts 1.X validwhen

2007-08-15 Thread Viplav Kallepu
Hi,

 I am using struts 1.3.8 for my application. For validation I am using
validator framework. In one of my pages my form is submitted either by
submit button or changing the dropdown list value. "action" is the name of
the property in the corresponding actionform which stores the submit
button's value for example if the submit button's value is "Modify" then
action property value is "Modify" and action property value is "null" if I
submit the page using change in the dropdown list value. I am using
validwhen to check if the action property is "Modify" as shown below,






  

   test

  ((action != "Modify") or (*this* !=
null))

 

   


 
My doubt is can I use two validations using the which will be called only
when action != "modify". like I want to check whether the email address is
in right format so I used
 and rest of the
code as shown above but it is checking for email format even if action is
not equal to "Modify". By seeing the code it seems that validwhen it is
taking different and email it is taking different. Then how can I use both.
Can any one please help me whether I can use validwhen In this situation. If
not validwhen how can I use the validator framework.
-- 
Regards
Viplav Kallepu

-- 
Regards
Viplav Kallepu


Re: struts2 ajax jsps

2007-08-15 Thread Ian Roughley
As it seems like you want to find a solution the option is to write 
an ActionMapper that reverses the order the URLs are currently 
determined.  Instead of looking for an action first, you would need to 
look for a static resource first, and then if not found check for an action.


/Ian

Struts2 Fan wrote:

I know that discussion but it "html" extention locks some of the
functionality of struts2, it would be better to change it from "html" to
something else. If you say *it is not easy*, at least I will post a message
on the appfuse forum. 



Ian Roughley wrote:
  
I think there was a discussion from Matt about this (appfuse using html 
extensions) a while back, you might want to check the archives.  On the 
s2 side, there are options, but I'm not sure there is an easy solution 
for using .html as an extension.


/Ian

Struts2 Fan wrote:


Opps How can I make struts to ignore this and read them as html? Or
do I
have to change the extention to get it work.

Thanks for the answer.


Ian Roughley wrote:
  
  

This line:

There is no Action mapped for namespace
/struts/dojo/src/widget/templates
and action name TabContainer. 

Seems to suggest that you may have changed the extension from ".action" 
to ".html", so s2 is looking for an action called TabContainer.


/Ian
Struts2 Fan wrote:



I met the same error, too.

I have just a simple jsp

 start of simple.jsp 
<%@ include file="/common/taglibs.jsp" %>






  




This is the right pane


 end of simple.jsp 

Here it gives the following error

 start of error 
 ERROR [btpool0-2] Dispatcher.serviceAction(512) | Could not find
action
or
result
There is no Action mapped for namespace
/struts/dojo/src/widget/templates
and action name TabContainer. - [unknown location]
at
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186)
at
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.appfuse.webapp.filter.StaticFilter.doFilterInternal(StaticFilter.java:106)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:350)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:75)
at
net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:92)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.appfuse.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:64)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at
org.acegisecurity.ui.ExceptionTranslationFilter.

Re: Trouble getting to portlet render phase

2007-08-15 Thread Nils-Helge Garli
So it doesn't work in neither JBoss nor your tests? Or is it just your
test that is not working?

Since executeRegularServletResult is executed, the only two reasons are:

- The portletrequest and portletresponse objects are not available,
which means you're running outside the container.
- The urls used to access the portlet is incorrect.

I'm not familiar with portletunit, but have you set up the request and
response objects correctly? Maybe you have an example unit test you
can show us?

BTW: If you want to test your portlets visually without starting a
heavy-weight container, take a look at my two blog articles regarding
testing portlets with pluto and maven:

http://portletwork.blogspot.com/2007/07/mvnjetty-and-portlets.html
http://portletwork.blogspot.com/2007/08/maven-jetty-plugin-and-jsr168-portlets.html

On 8/15/07, Frederick N. Brier <[EMAIL PROTECTED]> wrote:
> In my portletunit test, I am using a url of
> "view/viewMyPortlet.action".  In JBossPortal, I create a Portlet
> Instance from the Portlet Definition and then under the Portlet Objects
> tab assign it to a region in the page layout.  Is there somewhere I
> would specify a URL?  And what would it be?  What URL would you suggest
> I specify in portletunit?  That would be helpful as I am trying to use
> that as a test harness and avoid launching a container.  Thank you!!
>
> Fred
>
> Nils-Helge Garli wrote:
> > Are you creating the urls correctly using the s:url tag? Do you have
> > an example JSP? How do you invoke your portlet application? Remember
> > that you can't access the portlet using regular urls, they all have to
> > go through the portlet container.
> >
> > Nils-H
> >
> > On 8/15/07, Frederick N. Brier <[EMAIL PROTECTED]> wrote:
> >
> >> I am pretty sure this is a configuration issue, probably in struts.xml.
> >> I am trying to create a JSR168 compliant portlet.  I have been working
> >> with the portletunit code to get it to execute in a unit test, as well
> >> as running it with JBossPortal.  The behavior is the same, so I am
> >> hoping it is not an issue of the test harness introducing an issue.  I
> >> debug/traced the execution.  The Action is correctly constructed using
> >> the SpringFactory along with all properties.  It is invoked and executes
> >> without error.  It gets to DefaultActionInvocation having created a
> >> PortletResult, and calls result.execute(this).  The lastFinalLocation is
> >> set to the location of the jsp specified in the struts.xml.
> >> PortletResult.doExecute() calls executeRegularServletResult().
> >>
> >> Should I have been in render mode at this point and had
> >> executeRenderResult called instead?  I have seen a number of posting
> >> saying "best practice" is to redirect to another action executing in
> >> render phase that then specifies the jsp as the result.  Mine ends up
> >> calling PreparatorServlet.service and sets up the servlet request
> >> parameters into the ActionContext, and then ends, having never called
> >> the jsp.  I also am not seeing where the Jsr168Dispatcher is ever
> >> invoked.  It does not show up in the stack as I execute.  I do not know
> >> if that is an issue.
> >>
> >> I have tried a number of combinations of XML including trying to
> >> redirect to a "renderDirect.action" which then redirects to the .jsp.
> >> Problem is that I have found no examples of using this action, and I
> >> have not stumbled on the answer.  I have tried setting the result type
> >> to redirect... no joy.  I am using Struts 2.0.9.  If anyone could take a
> >> peek at my struts.xml and tell me what I am doing wrong, I would be
> >> eternally grateful.  I do not understand how my code differs from the
> >> HelloWorld portlet examples that I started with.  Thank you.
> >>
> >> Fred
> >>
> >> --struts.xml---
> >> 
> >>  >> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> >> "http://struts.apache.org/dtds/struts-2.0.dtd";>
> >>
> >> 
> >> 
> >>
> >>
> >>   
> >>  
> >>  
> >>  
> >>  
> >>   
> >>   
> >>
> >>
> >>
> >>   
> >>  /WEB-INF/view/MyPortlet.jsp
> >>   
> >>   
> >>  /WEB-INF/view/MyPortlet.jsp
> >>   
> >>   
> >>   >> name="success">/WEB-INF/view/MyPortletSubcomponent1.jsp
> >>   
> >>
> >>
> >>
> >>   
> >>  /WEB-INF/edit/index.jsp
> >>   
> >>
> >>
> >>
> >>   
> >>  /WEB-INF/help/index.jsp
> >>   
> >>
> >> 
> >> --applicationContext.xml---
> >> ...
> >>>> scope="prototype" autowire="byName">
> >> ...
> >>   
> >> ...
> >> --portlet.xml
> >>  >> xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";
> >>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >> xsi:schemaLocation="http://java.sun.com/xml/ns/po

Struts2 Annotation Based Validation

2007-08-15 Thread David Copeland
I'm a Struts newb and am trying to get up to speed on Struts 2.

The scant documentation is throwing me a bit; I'm trying to do
everything annotation-based, and for Validation, it seems to be simply
not working at all.

Per the docs, I have tagged my action class with @Validator and tagged
my setXXX method with @RequiredFieldValidator.

My form's JSP contains XXX.

When I submit the form with no value for XXX, my execute method
executes as it would before I added the validation stuff.

I would really like to avoid XML files, but it seems that if I'm using
annotations, everything needs to be done that way.

Any ideas on where to look?

Dave

I've read: http://struts.apache.org/2.x/docs/validation-annotation.html
and some other resources, none of which are clear to me.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Doubled requests in TabbedPane

2007-08-15 Thread Sebastian Kolbe
Hi

Ah, thanks very much. Thats exactly what i need. :-)

-- 
Sebastian

Jeromy Evans schrieb:
> In response to your second question:
>
> Sebastian Kolbe wrote:
>> Another question:
>> Is there an easy way to catch the event (something like 'onclick') when
>> a different tab is selected?
>>
>>   
> Yes :
> a. at page init time, lookup the id of each tab widget
> b. connect a handler "before" the "show" event generated by the widget
>
> The following javascript will call the handle1 or handle2 function
> when tab1 or tab2 is selected respectively.
>  function handler1(evt) {
>// do something
>  }
>  function handler2(evt) {
>// do something
>  }
>
>  function init() {
>  var tab1Widget = dojo.widget.byId("tab1");
>  var tab2Widget = dojo.widget.byId("tab2");
>
>  dojo.event.connect("before", tab1Widget, "show", handler1);
>  dojo.event.connect("before", tab2Widget, "show", handler2);
>  }
>
>  dojo.addOnLoad(  init );
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



S2: OGNL beats me

2007-08-15 Thread Twins fan
Hi,

I have a bean in request scope which has a List property. I cannot
iterate over it or read it at all. Among the lines below only the first
works. Could somebody please explain why?

${req.css[0]}





Thanks,
kuvera


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: OGNL beats me

2007-08-15 Thread Musachy Barroso
try :



musachy

On 8/15/07, Twins fan <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a bean in request scope which has a List property. I cannot
> iterate over it or read it at all. Among the lines below only the first
> works. Could somebody please explain why?
>
> ${req.css[0]}
> 
> 
> 
> 
>
> Thanks,
> kuvera
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: OGNL beats me

2007-08-15 Thread Twins fan
Thanks for both of you.



Only this one works for struts tags, but I still don't fully understand
the notion of the value stack. It is supposed to give access to
properties of all scopes, isn't it? Standard EL is not so complicated.

kuvera


Musachy Barroso írta:
> try :
> 
> 
> 
> musachy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Forward to different JSPs

2007-08-15 Thread Laurie Harper

Jasper Floor wrote:

On 8/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hi,



So here it is only possible to return to the given input JSP "dataChecks.jsp". 
How can I return to the calling JSP without defining one action tag for every single JSP?


If you don't close your actionmapping right away you can put 
tags in which you can define diffrent places to go.


   


In your action class you can look for request params to decde which way to go.

http://struts.apache.org/1.3.8/userGuide/building_controller.html#config

for more info.


Also note that you don't need to define 'input' for every action. It is 
only used if the action is accepting and validating a form submit, and 
the validation fails. So, you will need a separate action mapping for 
form submission you want to handle with a different input page but 
should be able to remove input from your other action mappings.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 2.0.9 UnknownClassVersionError

2007-08-15 Thread Laurie Harper

Hartrich, James CTR USTRANSCOM J6 wrote:

I'm getting an UnknownClassVersion error during struts2.0.9 deployment
to tomcat with java 1.5.0.0.3 


Is struts 2.0.9 entirely compiled in java 6?


Struts 2.0.9 targets the JDK 1.5 runtime. It shouldn't matter which JDK 
was used to compile, unless there's a problem in the build process. Are 
you certain you're picking up the right JDK? (i.e. that you aren't 
accidentally using 1.4 or something?) What is the exact error message 
you're getting?


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 Annotation Based Validation

2007-08-15 Thread Laurie Harper

David Copeland wrote:

I'm a Struts newb and am trying to get up to speed on Struts 2.

The scant documentation is throwing me a bit; I'm trying to do
everything annotation-based, and for Validation, it seems to be simply
not working at all.

Per the docs, I have tagged my action class with @Validator and tagged
my setXXX method with @RequiredFieldValidator.

My form's JSP contains XXX.

When I submit the form with no value for XXX, my execute method
executes as it would before I added the validation stuff.

I would really like to avoid XML files, but it seems that if I'm using
annotations, everything needs to be done that way.


I'm not sure what that last paragraph means; you can certainly use XML 
validation for one action and annotations in another. I'm not sure to 
what extent it's possible to mix XML and annotation based validation in 
the *same* action, but there's certainly no requirement to pick one or 
the other for the application as a whole.


It may help if you post the relevant parts of your config, JSP and 
action code. There are several 'moving parts' involved in making 
validation work, and it's hard to guess where the problem is without 
seeing what you have done.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 1.X validwhen

2007-08-15 Thread Laurie Harper

Viplav Kallepu wrote:

Hi,

 I am using struts 1.3.8 for my application. For validation I am using
validator framework. In one of my pages my form is submitted either by
submit button or changing the dropdown list value. "action" is the name of
the property in the corresponding actionform which stores the submit
button's value for example if the submit button's value is "Modify" then
action property value is "Modify" and action property value is "null" if I
submit the page using change in the dropdown list value. I am using
validwhen to check if the action property is "Modify" as shown below,






  

   test

  ((action != "Modify") or (*this* !=
null))

 

   


 
My doubt is can I use two validations using the which will be called only
when action != "modify". like I want to check whether the email address is
in right format so I used
 and rest of the
code as shown above but it is checking for email format even if action is
not equal to "Modify". By seeing the code it seems that validwhen it is
taking different and email it is taking different. Then how can I use both.
Can any one please help me whether I can use validwhen In this situation. If
not validwhen how can I use the validator framework.


I could be wrong, but I don't think what you want to do is supported. If 
I understood you correctly, you want to be able to specify multiple 
validations (in this case, 'validwhen' and 'email') and only apply the 
second rule if the first one *fails*. The opposite is possible (as soon 
as one validation rule fails, stop processing subsequent ones), but not 
the behaviour you're looking for.


You will probably need to write a custom validator to accomplish your 
goal. It might be possible to extend the validation framework to support 
both semantics for 'depends' processing, though, in which case you might 
consider contributing a patch for that as this would probably be useful 
for others too.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using the Restful2ActionMapper

2007-08-15 Thread mraible

I'm trying to change from using the old-style URLs to Restful2ActionMapper.
Here's what I've added to struts.xml:




I have a UserAction that does CRUD (below).

And the following action definitions:



userList.jsp
userList.jsp




userForm.jsp
userList.jsp




users.html
users.html
userForm.jsp
saveUserWithValidation



userForm.jsp
users.html


Is it possible to change to something like the following?

  
{0}
...
  

If so, I'm guessing I need to change some method names (i.e. the default
method for /user would be index, so I should change list() to index()) and
some result names (edit goes to "edit", save goes to "save", index goes to
"success")?

Thanks,

Matt


Philip Lorenz-2 wrote:
> 
> 
>> 
>> Tomorrow's task for me is trying RESTful, so hopefully
>> you'll figure this out ;)
>> 
>> Do you need the ".action" in the URL?!
>> 
>> d.
> 
> You can remove the action postfix by setting struts.action.extension to an
> empty string. I just left it enabled to have a clean default config with
> only the neccesary settings changed.
> 
> Philip
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-the-Restful2ActionMapper-tf3173361.html#a12171692
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 Annotation Based Validation

2007-08-15 Thread j alex
I think annotations give you more flexibility than XML .

ex : if an Action has multiple methods and only certain fields are
tied to each method, we can bunch together validations for each method
using annotations, but this is not possible using XML

On 8/15/07, Laurie Harper <[EMAIL PROTECTED]> wrote:
> David Copeland wrote:
> > I'm a Struts newb and am trying to get up to speed on Struts 2.
> >
> > The scant documentation is throwing me a bit; I'm trying to do
> > everything annotation-based, and for Validation, it seems to be simply
> > not working at all.
> >
> > Per the docs, I have tagged my action class with @Validator and tagged
> > my setXXX method with @RequiredFieldValidator.
> >
> > My form's JSP contains XXX.
> >
> > When I submit the form with no value for XXX, my execute method
> > executes as it would before I added the validation stuff.
> >
> > I would really like to avoid XML files, but it seems that if I'm using
> > annotations, everything needs to be done that way.
>
> I'm not sure what that last paragraph means; you can certainly use XML
> validation for one action and annotations in another. I'm not sure to
> what extent it's possible to mix XML and annotation based validation in
> the *same* action, but there's certainly no requirement to pick one or
> the other for the application as a whole.
>
> It may help if you post the relevant parts of your config, JSP and
> action code. There are several 'moving parts' involved in making
> validation work, and it's hard to guess where the problem is without
> seeing what you have done.
>
> L.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts2 Annotation Based Validation

2007-08-15 Thread Dave Newton
--- j alex <[EMAIL PROTECTED]> wrote:
> ex : if an Action has multiple methods and only
> certain fields are tied to each method, we can
> bunch together validations for each method
> using annotations, but this is not possible using
> XML

You can create validation XML files on an action-alias
basis.

d.



   

Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to make initialize with struts2 action?

2007-08-15 Thread red phoenix
For general Java class,we can make construction function,like this:
public class test{
  String a;
  public test(String a){
 this.a=a;
  }
}

I don't know if I can do it like above code under struts2 action,for some
reason,I want to initialize some variable and assign some value to it,like
follows:
public class MyClass extends ActionSupport{
private ;
public MyClass(SomeType s){
   //make some common operaction,such get session and so on,because I
want to run them only once
}
public String execute() throws Exception {
  
}
public String .{
}
   ...
}

I can successly compile above code,but when I run above code,it will say
error:
1)MyClass action error
2)java.lang.NullException because some code in MyClass(SomeType s)

When I remove the code in the MyClass(SomeType s) into execute() function,it
can run well.  I am puzzle with it! Anybody could tell me how to do it?  An
example is better.

Thanks,
phoenix


Re: How to make initialize with struts2 action?

2007-08-15 Thread meisam sarabadani
Does anybody know how to configure struts on eclipse and build anew project
by struts in eclipse ?

On 8/16/07, red phoenix <[EMAIL PROTECTED]> wrote:
>
> For general Java class,we can make construction function,like this:
> public class test{
>   String a;
>   public test(String a){
>  this.a=a;
>   }
> }
>
> I don't know if I can do it like above code under struts2 action,for some
> reason,I want to initialize some variable and assign some value to it,like
> follows:
> public class MyClass extends ActionSupport{
> private ;
> public MyClass(SomeType s){
>//make some common operaction,such get session and so on,because I
> want to run them only once
> }
> public String execute() throws Exception {
>   
> }
> public String .{
> }
>...
> }
>
> I can successly compile above code,but when I run above code,it will say
> error:
> 1)MyClass action error
> 2)java.lang.NullException because some code in MyClass(SomeType s)
>
> When I remove the code in the MyClass(SomeType s) into execute()
> function,it
> can run well.  I am puzzle with it! Anybody could tell me how to do
> it?  An
> example is better.
>
> Thanks,
> phoenix
>



-- 
Appreciated much,

Meisam Sarabadani
IBM Student Ambassador
Vice president II, IT Society
Multimedia University, Cyberjaya Capmus
--
"The day the Lord created hope was probably the same day he created
Spring."  Bern Williams.
--


Re: tiles DTD

2007-08-15 Thread Paul Benedict
If your code is going otu to the Internet to find the DTD, that means 
the DTD cannot be found locally. Depending on the type of Servlet API 
(<= 2.2), you would have to put the DTD directly in the WEB-INF directly 
and reference a URI to that location. Otherwise, API >= 2.3 will be able 
to find it directly from your WEB-INF/lib directory. Check your web.xml 
to see what version you're using.


Paul

Stephen Souness wrote:

Hi guys,

I'm pretty sure this will have been asked before, but a bit of 
Googling hasn't produced a satisfactory answer.


I'm using Struts 1.2.8 with tiles on Tomcat 5.5

Whenever I re-deploy my site some code goes off to look for the tiles 
DTD file (as specified at the top of tiles-definitions.xml).


When the website that hosts that DTD is unavailable (such as right 
now) the application fails to make the Struts action servlet available.


How can I remove this external dependency?

--
Stephen Souness


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to make initialize with struts2 action?

2007-08-15 Thread Andvar Woo
You can refer to the Struts doc.
The easiest way is  to use the struts2-blank-2.0.9.war as a start.
you can find it  from the http://struts.apache.org
You'd better download a struts-2.x.all.zip from the download pages.
Hope that helps,good luck.
2007/8/16, meisam sarabadani <[EMAIL PROTECTED]>:
>
> Does anybody know how to configure struts on eclipse and build anew
> project
> by struts in eclipse ?
>
> On 8/16/07, red phoenix <[EMAIL PROTECTED]> wrote:
> >
> > For general Java class,we can make construction function,like this:
> > public class test{
> >   String a;
> >   public test(String a){
> >  this.a=a;
> >   }
> > }
> >
> > I don't know if I can do it like above code under struts2 action,for
> some
> > reason,I want to initialize some variable and assign some value to
> it,like
> > follows:
> > public class MyClass extends ActionSupport{
> > private ;
> > public MyClass(SomeType s){
> >//make some common operaction,such get session and so on,because
> I
> > want to run them only once
> > }
> > public String execute() throws Exception {
> >   
> > }
> > public String .{
> > }
> >...
> > }
> >
> > I can successly compile above code,but when I run above code,it will say
> > error:
> > 1)MyClass action error
> > 2)java.lang.NullException because some code in MyClass(SomeType s)
> >
> > When I remove the code in the MyClass(SomeType s) into execute()
> > function,it
> > can run well.  I am puzzle with it! Anybody could tell me how to do
> > it?  An
> > example is better.
> >
> > Thanks,
> > phoenix
> >
>
>
>
> --
> Appreciated much,
>
> Meisam Sarabadani
> IBM Student Ambassador
> Vice president II, IT Society
> Multimedia University, Cyberjaya Capmus
> --
> "The day the Lord created hope was probably the same day he created
> Spring."  Bern Williams.
> --
>


Re: How to make initialize with struts2 action?

2007-08-15 Thread meisam sarabadani
hey

thanks for your help but the thing is that it does not work like that in
eclipse, yeah I have downloaded the full pack of struts and the all
exampels, and also i have deployed it manually by putting it into my
container (tomcat), but when im going to use the eclipse as IDE to develop
and start a struts everything messes and I can`t continue, actually it is
not working, I have seen so many tutorials but none of is 100% sure about
what they are saying, can you help me with this ?


On 8/16/07, Andvar Woo <[EMAIL PROTECTED]> wrote:
>
> You can refer to the Struts doc.
> The easiest way is  to use the struts2-blank-2.0.9.war as a start.
> you can find it  from the http://struts.apache.org
> You'd better download a struts-2.x.all.zip from the download pages.
> Hope that helps,good luck.
> 2007/8/16, meisam sarabadani <[EMAIL PROTECTED]>:
> >
> > Does anybody know how to configure struts on eclipse and build anew
> > project
> > by struts in eclipse ?
> >
> > On 8/16/07, red phoenix <[EMAIL PROTECTED]> wrote:
> > >
> > > For general Java class,we can make construction function,like this:
> > > public class test{
> > >   String a;
> > >   public test(String a){
> > >  this.a=a;
> > >   }
> > > }
> > >
> > > I don't know if I can do it like above code under struts2 action,for
> > some
> > > reason,I want to initialize some variable and assign some value to
> > it,like
> > > follows:
> > > public class MyClass extends ActionSupport{
> > > private ;
> > > public MyClass(SomeType s){
> > >//make some common operaction,such get session and so
> on,because
> > I
> > > want to run them only once
> > > }
> > > public String execute() throws Exception {
> > >   
> > > }
> > > public String .{
> > > }
> > >...
> > > }
> > >
> > > I can successly compile above code,but when I run above code,it will
> say
> > > error:
> > > 1)MyClass action error
> > > 2)java.lang.NullException because some code in MyClass(SomeType s)
> > >
> > > When I remove the code in the MyClass(SomeType s) into execute()
> > > function,it
> > > can run well.  I am puzzle with it! Anybody could tell me how to do
> > > it?  An
> > > example is better.
> > >
> > > Thanks,
> > > phoenix
> > >
> >
> >
> >
> > --
> > Appreciated much,
> >
> > Meisam Sarabadani
> > IBM Student Ambassador
> > Vice president II, IT Society
> > Multimedia University, Cyberjaya Capmus
> > --
> > "The day the Lord created hope was probably the same day he created
> > Spring."  Bern Williams.
> > --
> >
>



-- 
Appreciated much,

Meisam Sarabadani
IBM Student Ambassador
Vice president II, IT Society
Multimedia University, Cyberjaya Capmus
--
"The day the Lord created hope was probably the same day he created
Spring."  Bern Williams.
--


Serious need

2007-08-15 Thread meisam sarabadani
I have downloaded the full pack of struts and the all exampels, and also i
have deployed it manually by putting it into my container (tomcat), but when
im going to use the eclipse as IDE to develop and start a struts everything
messes and I can`t continue, actually it is not working, I have seen so many
tutorials but none of is 100% sure about what they are saying, can you help
me with this ?

On 8/16/07, meisam sarabadani <[EMAIL PROTECTED]> wrote:
>
> hey
>
> thanks for your help but the thing is that it does not work like that in
> eclipse, yeah I have downloaded the full pack of struts and the all
> exampels, and also i have deployed it manually by putting it into my
> container (tomcat), but when im going to use the eclipse as IDE to develop
> and start a struts everything messes and I can`t continue, actually it is
> not working, I have seen so many tutorials but none of is 100% sure about
> what they are saying, can you help me with this ?
>
>
> On 8/16/07, Andvar Woo <[EMAIL PROTECTED]> wrote:
> >
> > You can refer to the Struts doc.
> > The easiest way is  to use the struts2-blank-2.0.9.war as a start.
> > you can find it  from the http://struts.apache.org
> > You'd better download a struts-2.x.all.zip from the download pages.
> > Hope that helps,good luck.
> > 2007/8/16, meisam sarabadani <[EMAIL PROTECTED]>:
> > >
> > > Does anybody know how to configure struts on eclipse and build anew
> > > project
> > > by struts in eclipse ?
> > >
> > > On 8/16/07, red phoenix <[EMAIL PROTECTED]> wrote:
> > > >
> > > > For general Java class,we can make construction function,like this:
> > > > public class test{
> > > >   String a;
> > > >   public test(String a){
> > > >  this.a=a;
> > > >   }
> > > > }
> > > >
> > > > I don't know if I can do it like above code under struts2 action,for
> >
> > > some
> > > > reason,I want to initialize some variable and assign some value to
> > > it,like
> > > > follows:
> > > > public class MyClass extends ActionSupport{
> > > > private ;
> > > > public MyClass(SomeType s){
> > > >//make some common operaction,such get session and so
> > on,because
> > > I
> > > > want to run them only once
> > > > }
> > > > public String execute() throws Exception {
> > > >   
> > > > }
> > > > public String .{
> > > > }
> > > >...
> > > > }
> > > >
> > > > I can successly compile above code,but when I run above code,it will
> > say
> > > > error:
> > > > 1)MyClass action error
> > > > 2)java.lang.NullException because some code in MyClass(SomeType s)
> > > >
> > > > When I remove the code in the MyClass(SomeType s) into execute()
> > > > function,it
> > > > can run well.  I am puzzle with it! Anybody could tell me how to do
> > > > it?  An
> > > > example is better.
> > > >
> > > > Thanks,
> > > > phoenix
> > > >
> > >
> > >
> > >
> > > --
> > > Appreciated much,
> > >
> > > Meisam Sarabadani
> > > IBM Student Ambassador
> > > Vice president II, IT Society
> > > Multimedia University, Cyberjaya Capmus
> > > --
> > > "The day the Lord created hope was probably the same day he created
> > > Spring."  Bern Williams.
> > > --
> > >
> >
>
>
>
> --
> Appreciated much,
>
> Meisam Sarabadani
> IBM Student Ambassador
> Vice president II, IT Society
> Multimedia University, Cyberjaya Capmus
> --
> "The day the Lord created hope was probably the same day he created
> Spring."  Bern Williams.
> --
>



-- 
Appreciated much,

Meisam Sarabadani
IBM Student Ambassador
Vice president II, IT Society
Multimedia University, Cyberjaya Capmus
--
"The day the Lord created hope was probably the same day he created
Spring."  Bern Williams.
--


Re: How to make initialize with struts2 action?

2007-08-15 Thread Rec Floyd
Hey,red.In my opinion, to use struts, you have to supply a no-argument
constructor.That is the point.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tiles DTD

2007-08-15 Thread Stephen Souness

The post at:

http://article.gmane.org/gmane.comp.jakarta.struts.user/78202/

seems to go into a bit more detail about this issue.

Is it possible that the version of Struts that I am using doesn't have 
the correct location(s) set up for pointing at the internal resources 
referred to in that post?


Working day is over in my timezone, but I'll look into it further tomorrow.

--
Stephen



Paul Benedict wrote:
If your code is going otu to the Internet to find the DTD, that means 
the DTD cannot be found locally. Depending on the type of Servlet API 
(<= 2.2), you would have to put the DTD directly in the WEB-INF directly 
and reference a URI to that location. Otherwise, API >= 2.3 will be able 
to find it directly from your WEB-INF/lib directory. Check your web.xml 
to see what version you're using.


Paul

Stephen Souness wrote:

Hi guys,

I'm pretty sure this will have been asked before, but a bit of 
Googling hasn't produced a satisfactory answer.


I'm using Struts 1.2.8 with tiles on Tomcat 5.5

Whenever I re-deploy my site some code goes off to look for the tiles 
DTD file (as specified at the top of tiles-definitions.xml).


When the website that hosts that DTD is unavailable (such as right 
now) the application fails to make the Struts action servlet available.


How can I remove this external dependency?

--
Stephen Souness


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to make initialize with struts2 action?

2007-08-15 Thread red phoenix
If I use no-argument constructor,how can i do to initialize some
information?
Thanks


On 8/16/07, Rec Floyd <[EMAIL PROTECTED]> wrote:
>
> Hey,red.In my opinion, to use struts, you have to supply a no-argument
> constructor.That is the point.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


[S2] Type Validation Error Message

2007-08-15 Thread Struts2 Fan

When there is an integer type and the user writes non string value, an error
message is displayed automaticly. "Invalid field value for field "xxx.yyy"
I want to make this message localized. I posted a message before. But I
don't want to write bundles for all the integer, double and date fields in
the application. I just want to make it Turkish. The question is "is there a
place to make the message Turkish or any other language". 


Rene Gielen wrote:
> 
> To provide your own conversion error message for a specific field, you
> will have to provide a resource message following the naming convention
> 
> invalid.fieldvalue.yourpropertyname
> 
> This should override the default message.
> 
> - Rene
> 

Here I have to write a whole bunch of messages. But it is a general error
message, so it should be changed by just adding the "Turkish translation" of
the default message. But I couldn't manage where to add. I even couldn't
find where does the message "Invalid field value for field" stand in the
struts2. 

http://www.nabble.com/-S2--How-to-change-%22Invalid-field-value-for-field%22-message-in-tr-tf3688720.html#a10312377

I hope It is understandable. 

Thanks in advance.
-- 
View this message in context: 
http://www.nabble.com/-S2--Type-Validation-Error-Message-tf4277669.html#a12175727
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to make initialize with struts2 action?

2007-08-15 Thread Leonidas Papadakis
I think you can use the setters after you initialize your class 
i.e.instead of

MyType mt = new MyType(...parameters...);
to do :
MyType mt = new MyType();
mt.setParam1()
e.t.c. I am not exactly sure if this is what you are after though 
Why do you want to do this ?


Leon

red phoenix wrote:

If I use no-argument constructor,how can i do to initialize some
information?
Thanks


On 8/16/07, Rec Floyd <[EMAIL PROTECTED]> wrote:
  

Hey,red.In my opinion, to use struts, you have to supply a no-argument
constructor.That is the point.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  


Re: Serious need

2007-08-15 Thread Andvar Woo
Firstly,create a empty dynamic web project. That needs some plug-ins to
support,you can try "Lomboz"
sencondly,copy/import the following 5 essential jars to the /WEB-INF/lib
folder
struts2-core.jar
xwork.jar
ognl.jar
freemarker.jar
commons-logging.jar
you can find these jars in the strtus pack you downloaded.

thirdly,configure the web.xml , below  is a sample configure
---web.xmlstart---

http://java.sun.com/xml/ns/javaee";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";>

Struts2 configure sample

  struts2
  
org.apache.struts2.dispatcher.FilterDispatcher
  



  struts2
  /*

  
index.jsp
  


---web.xml end
-
then,create a struts.xml in the src forder (src/struts.xml) and configure
it,below is a sample.
you can refer the struts-doc 's guildes for how to configure "package
","action" and "result" elements

---struts.xmlstart---
http://struts.apache.org/dtds/struts-2.0.dtd";>

  
  

  /Ognl.jsp

  

---struts.xml end
---
I suggust you follow struts-doc's "Getting Started" to be familar with
struts2 step by step.
these docs are all contained in the full pack.
besides, the struts's "Big-picture" may help to understand struts2's
architecture
http://struts.apache.org/2.x/docs/big-picture.html
you can also find the doc in the full pack.
Hope the above helps.
Good luck.

2007/8/16, meisam sarabadani <[EMAIL PROTECTED]>:
>
> I have downloaded the full pack of struts and the all exampels, and also i
> have deployed it manually by putting it into my container (tomcat), but
> when
> im going to use the eclipse as IDE to develop and start a struts
> everything
> messes and I can`t continue, actually it is not working, I have seen so
> many
> tutorials but none of is 100% sure about what they are saying, can you
> help
> me with this ?
>
> On 8/16/07, meisam sarabadani <[EMAIL PROTECTED]> wrote:
> >
> > hey
> >
> > thanks for your help but the thing is that it does not work like that in
> > eclipse, yeah I have downloaded the full pack of struts and the all
> > exampels, and also i have deployed it manually by putting it into my
> > container (tomcat), but when im going to use the eclipse as IDE to
> develop
> > and start a struts everything messes and I can`t continue, actually it
> is
> > not working, I have seen so many tutorials but none of is 100% sure
> about
> > what they are saying, can you help me with this ?
> >
> >
> > On 8/16/07, Andvar Woo <[EMAIL PROTECTED]> wrote:
> > >
> > > You can refer to the Struts doc.
> > > The easiest way is  to use the struts2-blank-2.0.9.war as a start.
> > > you can find it  from the http://struts.apache.org
> > > You'd better download a struts-2.x.all.zip from the download pages.
> > > Hope that helps,good luck.
> > > 2007/8/16, meisam sarabadani <[EMAIL PROTECTED]>:
> > > >
> > > > Does anybody know how to configure struts on eclipse and build anew
> > > > project
> > > > by struts in eclipse ?
> > > >
> > > > On 8/16/07, red phoenix <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > For general Java class,we can make construction function,like
> this:
> > > > > public class test{
> > > > >   String a;
> > > > >   public test(String a){
> > > > >  this.a=a;
> > > > >   }
> > > > > }
> > > > >
> > > > > I don't know if I can do it like above code under struts2
> action,for
> > >
> > > > some
> > > > > reason,I want to initialize some variable and assign some value to
> > > > it,like
> > > > > follows:
> > > > > public class MyClass extends ActionSupport{
> > > > > private ;
> > > > > public MyClass(SomeType s){
> > > > >//make some common operaction,such get session and so
> > > on,because
> > > > I
> > > > > want to run them only once
> > > > > }
> > > > > public String execute() throws Exception {
> > > > >   
> > > > > }
> > > > > public String .{
> > > > > }
> > > > >...
> > > > > }
> > > > >
> > > > > I can successly compile above code,but when I run above code,it
> will
> > > say
> > > > > error:
> > > > > 1)MyClass action error
> > > > > 2)java.lang.NullException because some code in MyClass(SomeType s)
> > > > >
> > > > > When I remove the code in the MyClass(SomeType s) into execute()
> > > > > function,it
> > > > > can run well.  I am puzzle with it! Anybody could tell me how to
> do
> > > > > it?  An
> > > > > example is better.
> > > > >
> > > > > Thanks,
> > > > > phoenix
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Appreciated much,
> > > >
> > > > Meisam Sarabadani
> > > > IBM Student Ambassador
> > > > Vice president II, IT Society
> > > > Multimedia University, Cyberjaya Capmus
> > > > -

Re: How to make initialize with struts2 action?

2007-08-15 Thread red phoenix
I know your meaning,but the question I want to Initialize in struts
action,not in common class,because I want to get WebApplicationContext in
struts action,and then I will transfer WebApplicationContext into dao to get
data. I don't know if there is a init method in struts2 action?
Any idea will be appreciated!


On 8/16/07, Leonidas Papadakis <[EMAIL PROTECTED]> wrote:
>
> I think you can use the setters after you initialize your class
> i.e.instead of
> MyType mt = new MyType(...parameters...);
> to do :
> MyType mt = new MyType();
> mt.setParam1()
> e.t.c. I am not exactly sure if this is what you are after though
> Why do you want to do this ?
>
> Leon
>
> red phoenix wrote:
> > If I use no-argument constructor,how can i do to initialize some
> > information?
> > Thanks
> >
> >
> > On 8/16/07, Rec Floyd <[EMAIL PROTECTED]> wrote:
> >
> >> Hey,red.In my opinion, to use struts, you have to supply a no-argument
> >> constructor.That is the point.
> >>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >
> >
>


Re: How to make initialize with struts2 action?

2007-08-15 Thread Andvar Woo
You may try the static block, a no-arg constructor is needed to initialize a
Action object by struts
static
{
  //doSomeInit,this only run once
}


2007/8/16, red phoenix <[EMAIL PROTECTED]>:
>
> I know your meaning,but the question I want to Initialize in struts
> action,not in common class,because I want to get WebApplicationContext in
> struts action,and then I will transfer WebApplicationContext into dao to
> get
> data. I don't know if there is a init method in struts2 action?
> Any idea will be appreciated!
>
>
> On 8/16/07, Leonidas Papadakis <[EMAIL PROTECTED]> wrote:
> >
> > I think you can use the setters after you initialize your class
> > i.e.instead of
> > MyType mt = new MyType(...parameters...);
> > to do :
> > MyType mt = new MyType();
> > mt.setParam1()
> > e.t.c. I am not exactly sure if this is what you are after though
> > Why do you want to do this ?
> >
> > Leon
> >
> > red phoenix wrote:
> > > If I use no-argument constructor,how can i do to initialize some
> > > information?
> > > Thanks
> > >
> > >
> > > On 8/16/07, Rec Floyd <[EMAIL PROTECTED]> wrote:
> > >
> > >> Hey,red.In my opinion, to use struts, you have to supply a
> no-argument
> > >> constructor.That is the point.
> > >>
> > >> -
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >>
> > >
> > >
> >
>


Re: Serious need

2007-08-15 Thread meisam sarabadani
dude,

Let me try then I let you know quickly. :), but before that would you answer
my questions :

>That needs some plug-ins to support,you can try "Lomboz"
how to install Lomboz ? should i only get it and put it in a eclipse plugins
dir ?

>thirdly,configure the web.xml , below  is a sample configure
can i just copy and paste your sample ? or should i modify it? based on what
i need to modify my web.xml ?

>then,create a struts.xml in the src forder (src/struts.xml) and configure
it,below is a sample.

based on what I need to modify the sample xml files you sent to me ?!? im
confused here and i think here is where im making the mistakes.

I try to have a look at the docs .

thank you very much

On 8/16/07, Andvar Woo <[EMAIL PROTECTED]> wrote:
>
> Firstly,create a empty dynamic web project. That needs some plug-ins to
> support,you can try "Lomboz"
> sencondly,copy/import the following 5 essential jars to the /WEB-INF/lib
> folder
> struts2-core.jar
> xwork.jar
> ognl.jar
> freemarker.jar
> commons-logging.jar
> you can find these jars in the strtus pack you downloaded.
>
> thirdly,configure the web.xml , below  is a sample configure
> ---
> web.xmlstart---
> 
>  xmlns="http://java.sun.com/xml/ns/javaee";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";>
>
> Struts2 configure sample
>
>   struts2
>   
> org.apache.struts2.dispatcher.FilterDispatcher
>   
> 
>
> 
>   struts2
>   /*
> 
>   
> index.jsp
>   
> 
>
> ---web.xml end
> -
> then,create a struts.xml in the src forder (src/struts.xml) and configure
> it,below is a sample.
> you can refer the struts-doc 's guildes for how to configure "package
> ","action" and "result" elements
>
> ---
> struts.xmlstart---
>  PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd";>
> 
>   
>   
> 
>   /Ognl.jsp
> 
>   
> 
> ---struts.xml end
> ---
> I suggust you follow struts-doc's "Getting Started" to be familar with
> struts2 step by step.
> these docs are all contained in the full pack.
> besides, the struts's "Big-picture" may help to understand struts2's
> architecture
> http://struts.apache.org/2.x/docs/big-picture.html
> you can also find the doc in the full pack.
> Hope the above helps.
> Good luck.
>
> 2007/8/16, meisam sarabadani <[EMAIL PROTECTED]>:
> >
> > I have downloaded the full pack of struts and the all exampels, and also
> i
> > have deployed it manually by putting it into my container (tomcat), but
> > when
> > im going to use the eclipse as IDE to develop and start a struts
> > everything
> > messes and I can`t continue, actually it is not working, I have seen so
> > many
> > tutorials but none of is 100% sure about what they are saying, can you
> > help
> > me with this ?
> >
> > On 8/16/07, meisam sarabadani <[EMAIL PROTECTED]> wrote:
> > >
> > > hey
> > >
> > > thanks for your help but the thing is that it does not work like that
> in
> > > eclipse, yeah I have downloaded the full pack of struts and the all
> > > exampels, and also i have deployed it manually by putting it into my
> > > container (tomcat), but when im going to use the eclipse as IDE to
> > develop
> > > and start a struts everything messes and I can`t continue, actually it
> > is
> > > not working, I have seen so many tutorials but none of is 100% sure
> > about
> > > what they are saying, can you help me with this ?
> > >
> > >
> > > On 8/16/07, Andvar Woo <[EMAIL PROTECTED]> wrote:
> > > >
> > > > You can refer to the Struts doc.
> > > > The easiest way is  to use the struts2-blank-2.0.9.war as a start.
> > > > you can find it  from the http://struts.apache.org
> > > > You'd better download a struts-2.x.all.zip from the download pages.
> > > > Hope that helps,good luck.
> > > > 2007/8/16, meisam sarabadani <[EMAIL PROTECTED]>:
> > > > >
> > > > > Does anybody know how to configure struts on eclipse and build
> anew
> > > > > project
> > > > > by struts in eclipse ?
> > > > >
> > > > > On 8/16/07, red phoenix <[EMAIL PROTECTED]> wrote:
> > > > > >
> > > > > > For general Java class,we can make construction function,like
> > this:
> > > > > > public class test{
> > > > > >   String a;
> > > > > >   public test(String a){
> > > > > >  this.a=a;
> > > > > >   }
> > > > > > }
> > > > > >
> > > > > > I don't know if I can do it like above code under struts2
> > action,for
> > > >
> > > > > some
> > > > > > reason,I want to initialize some variable and assign some value
> to
> > > > > it,like
> > > > > > follows:
> > > > > > public class MyClass extends ActionSupport{
> > > > > > private ;
> > > > > > publi

Re: How to make initialize with struts2 action?

2007-08-15 Thread Nils-Helge Garli
So you're using Spring? In that case, maybe parts of this tutorial can
help: http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html

And here's the documentation for the Spring-plugin:
http://struts.apache.org/2.x/docs/spring-plugin.html

Nils-H

On 8/16/07, red phoenix <[EMAIL PROTECTED]> wrote:
> I know your meaning,but the question I want to Initialize in struts
> action,not in common class,because I want to get WebApplicationContext in
> struts action,and then I will transfer WebApplicationContext into dao to get
> data. I don't know if there is a init method in struts2 action?
> Any idea will be appreciated!
>
>
> On 8/16/07, Leonidas Papadakis <[EMAIL PROTECTED]> wrote:
> >
> > I think you can use the setters after you initialize your class
> > i.e.instead of
> > MyType mt = new MyType(...parameters...);
> > to do :
> > MyType mt = new MyType();
> > mt.setParam1()
> > e.t.c. I am not exactly sure if this is what you are after though
> > Why do you want to do this ?
> >
> > Leon
> >
> > red phoenix wrote:
> > > If I use no-argument constructor,how can i do to initialize some
> > > information?
> > > Thanks
> > >
> > >
> > > On 8/16/07, Rec Floyd <[EMAIL PROTECTED]> wrote:
> > >
> > >> Hey,red.In my opinion, to use struts, you have to supply a no-argument
> > >> constructor.That is the point.
> > >>
> > >> -
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >>
> > >
> > >
> >
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to make initialize with struts2 action?

2007-08-15 Thread red phoenix
static
{
 //doSomeInit,this only run once
}

above code can't run in struct2 action,it will say "can't use in non-static
class"

I use Struts2+spring2.1+hibernate3.2,I am puzzled with it for many many
days! I am looking for an example,but I don't find it,would you give me an
example project which can run under tomcat6?


On 8/16/07, Nils-Helge Garli <[EMAIL PROTECTED]> wrote:
>
> So you're using Spring? In that case, maybe parts of this tutorial can
> help: http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html
>
> And here's the documentation for the Spring-plugin:
> http://struts.apache.org/2.x/docs/spring-plugin.html
>
> Nils-H
>
> On 8/16/07, red phoenix <[EMAIL PROTECTED]> wrote:
> > I know your meaning,but the question I want to Initialize in struts
> > action,not in common class,because I want to get WebApplicationContext
> in
> > struts action,and then I will transfer WebApplicationContext into dao to
> get
> > data. I don't know if there is a init method in struts2 action?
> > Any idea will be appreciated!
> >
> >
> > On 8/16/07, Leonidas Papadakis <[EMAIL PROTECTED]> wrote:
> > >
> > > I think you can use the setters after you initialize your class
> > > i.e.instead of
> > > MyType mt = new MyType(...parameters...);
> > > to do :
> > > MyType mt = new MyType();
> > > mt.setParam1()
> > > e.t.c. I am not exactly sure if this is what you are after though
> > > Why do you want to do this ?
> > >
> > > Leon
> > >
> > > red phoenix wrote:
> > > > If I use no-argument constructor,how can i do to initialize some
> > > > information?
> > > > Thanks
> > > >
> > > >
> > > > On 8/16/07, Rec Floyd <[EMAIL PROTECTED]> wrote:
> > > >
> > > >> Hey,red.In my opinion, to use struts, you have to supply a
> no-argument
> > > >> constructor.That is the point.
> > > >>
> > > >>
> -
> > > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > > >>
> > > >>
> > > >>
> > > >
> > > >
> > >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: tiles DTD

2007-08-15 Thread Laurie Harper
It's more likely that you are using the wrong public identifier in your 
document type declaration. With the wrong public identifier, the 
resource (DTD file) won't be resolved locally and the parser will try to 
use the system identifier to locate the resource, as a fall back.


Check that the doctype you have specified is correct for the version of 
Struts/Tiles that you're using.


L.

Stephen Souness wrote:

The post at:

http://article.gmane.org/gmane.comp.jakarta.struts.user/78202/

seems to go into a bit more detail about this issue.

Is it possible that the version of Struts that I am using doesn't have 
the correct location(s) set up for pointing at the internal resources 
referred to in that post?


Working day is over in my timezone, but I'll look into it further tomorrow.

--
Stephen



Paul Benedict wrote:
If your code is going otu to the Internet to find the DTD, that means 
the DTD cannot be found locally. Depending on the type of Servlet API 
(<= 2.2), you would have to put the DTD directly in the WEB-INF 
directly and reference a URI to that location. Otherwise, API >= 2.3 
will be able to find it directly from your WEB-INF/lib directory. 
Check your web.xml to see what version you're using.


Paul

Stephen Souness wrote:

Hi guys,

I'm pretty sure this will have been asked before, but a bit of 
Googling hasn't produced a satisfactory answer.


I'm using Struts 1.2.8 with tiles on Tomcat 5.5

Whenever I re-deploy my site some code goes off to look for the tiles 
DTD file (as specified at the top of tiles-definitions.xml).


When the website that hosts that DTD is unavailable (such as right 
now) the application fails to make the Struts action servlet available.


How can I remove this external dependency?

--
Stephen Souness


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]