Re: wait interceptor

2008-10-07 Thread Paweł Wielgus
Hi Hardik,
http://struts.apache.org/2.x/docs/execute-and-wait-interceptor.html

Best greetings,
Paweł Wielgus.

2008/10/8 Hardik Shah <[EMAIL PROTECTED]>:
>
> it is possible to show wait.jsp in s2.0.11 between from one action to another
> execution process
> (means show my wait.jsp when action is on process)
>
> --
> View this message in context: 
> http://www.nabble.com/wait-interceptor-tp19872439p19872439.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


SV: SV: SV: Ognl versions

2008-10-07 Thread Gunnar.Bostrom
Hi,
You were right. It was the capitalization that was wrong.
Actually I didn't understood the comment about javabean as in my eyes it was a 
proper bean.
Your apology about null is taken!
I've seen problems in other places in our code that I need to investigate if it 
is the same problem!
Thanks for all help!
/Gunnar


> -Ursprungligt meddelande-
> Från: Dale Newfield [mailto:[EMAIL PROTECTED] 
> Skickat: den 7 oktober 2008 17:39
> Till: Struts Users Mailing List
> Ämne: Re: SV: SV: Ognl versions
> 
> [EMAIL PROTECTED] wrote:
> > We have a measureList that looks the same and it works!
> 
> It's not quite the same, since it's capitalization is correct.
> 
> >public SortedMap getMeasureList() {
> 
> Chris Pratt wrote:
> >> Just as an experiment, you might try renaming the method as a true 
> >> JavaBean method.  Maybe OGNL got more strict on it's 
> interpretation 
> >> of the spec.
> 
> The renaming he's mentioning is from getjobTypeList to 
> getJobTypeList :
> 
> >>>public SortedMap getjobTypeList() {
> 
> And my apologies for misunderstanding your comment about it 
> being null.
> 
> -Dale
> 
> -
> 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]



wait interceptor

2008-10-07 Thread Hardik Shah

it is possible to show wait.jsp in s2.0.11 between from one action to another
execution process
(means show my wait.jsp when action is on process)

-- 
View this message in context: 
http://www.nabble.com/wait-interceptor-tp19872439p19872439.html
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: howto cache the textfield

2008-10-07 Thread Jishnu Viswanath
Hi xianwinwin,
Pawel is correct, when you have a text field with name="Something" next 
time you come to page that contains text field with same name then you can 
double click it and get it.

I still did not get what you want to do, add the feature for not getting text 
fields, or remove feature for already getting text fields?

Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE


-Original Message-
From: Paweł Wielgus [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 07, 2008 12:06 PM
To: Struts Users Mailing List
Subject: Re: howto cache the textfield

Hi xianwinwin,
it's a firefox feature - remember entered form values or something like this,
so yes it has nothing to do with struts.
But You can achieve the same by adding ajax to this field
and remembering all posted data in Your app.

Best greetings,
Paweł Wielgus.

2008/10/6 xianwinwin <[EMAIL PROTECTED]>:
>
> I have a textfield where a user input information.
>
>
>  label="Destination"
> required="false"size="15"   />
>
> My question is this: how can I give the user previous input that he provided
> once he clicks the textfield; in other word, when he clicks (or double
> click) the textfield he can see (in a drop down box) what he entered before.
>
> for some reason, this works for some textfields and for some it doesn't (I
> guess it's not a struts issue).
> but still I wonder how to do that.
>
> thank you!
> --
> View this message in context: 
> http://www.nabble.com/howto-cache-the-textfield-tp19844989p19844989.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
Any comments or statements made in this email are not necessarily those of 
Tavant Technologies.
The information transmitted is intended only for the person or entity to which 
it is addressed and may 
contain confidential and/or privileged material. If you have received this in 
error, please contact the 
sender and delete the material from any computer. All e-mails sent from or to 
Tavant Technologies 
may be subject to our monitoring procedures.


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



RE: Using POSIX Regular Expressions for Internationalized Validation

2008-10-07 Thread Jishnu Viswanath
Hey egetchell,
Don't know weather that's your name but any way.
I don't know this is the solution you are looking for






Now you need to map the validator,
Put a validators.xml in resources folder, same folder as struts.xml
exist






ClassName should extend RegexFieldValidator
Override validate method, do what ever you want there. This should work.

Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE


-Original Message-
From: egetchell [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 07, 2008 8:02 PM
To: user@struts.apache.org
Subject: Re: Using POSIX Regular Expressions for Internationalized
Validation


Greg,

Thanks for the reply.

The common approach for mitigating XSS is to provide a blacklist of XSS
enabling characters, enables would include "<", ">", "%3f", etc.
However,
these filters are easily bypassed by clever encoding constructs, so the
blacklist concept quickly fails and the site is open for attack.  

By inverting the solution and supplying only the allowed set of
characters,
the site remains secure no matter what clever encoding scheme someone
dreams
up.  

The OWASP group provides some pretty extensive documentation around
this. 
Here is a direct link to some common validation strategies:
http://www.owasp.org/index.php/Data_Validation#Data_Validation_Strategie
s

Their document, as a whole, is a very intereseting read.


Greg Lindholm wrote:
> 
> Sorry, I've never heard of whitelisting of allowable characters as
being a
> "normal" approach.  
> 

-- 
View this message in context:
http://www.nabble.com/Using-POSIX-Regular-Expressions-for-Internationali
zed-Validation-tp19844314p19859522.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Any comments or statements made in this email are not necessarily those of 
Tavant Technologies.
The information transmitted is intended only for the person or entity to which 
it is addressed and may 
contain confidential and/or privileged material. If you have received this in 
error, please contact the 
sender and delete the material from any computer. All e-mails sent from or to 
Tavant Technologies 
may be subject to our monitoring procedures.


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



Re: How to capture this event

2008-10-07 Thread Tracy12

I tried lot of examples at 
http://struts.apache.org/2.1.2/docs/ajax-and-javascript-recipes.html#AjaxandJavaScriptRecipes-Donotloadtab2whenpageloads%2528itwillbeloadedwhenselected%2529

but nothing seems to work,

I know the above documentation is for struts 2.1 we are using struts 2.0.6

We have the AJAX  divs and tabbed panels inside a portal enviornment.

Has any of these events tried on portal env.

What I basically want it to trap the event when someone click one of the
divs which I am interested.

I tried notifyTopic,  beforeSelectTabNotifyTopics,
afterSelectTabNotifyTopics

but nothing seems to trap the click of the div

Pls let us know how to proceed


Thanks
Lalitha





Mark-413 wrote:
> 
> Oh ok.  That's beyond my knowledge.  Hopefully someone else on the  
> list can help you.
> Mark
> 
> On 07/10/2008, at 12:27 PM, Tracy12 wrote:
> 
>>
>> Mark,
>>
>> The Issue is eventhough the preload=false, each time you click the  
>> div the
>> content will be loaded,
>>
>> What I want is basically to capture the click event and load  
>> accordingly if
>> required.
>>
>> Thanks
>>
>>
>> Mark-413 wrote:
>>>
>>> While I haven't used it yet, my understanding is that if you set
>>> preload=false, the DIV won't load until the user clicks the tab.
>>> Then the content will load.  However, I've also found this issue:
>>> https://issues.apache.org/struts/browse/WW-1860 which you might be
>>> running into.
>>>
>>> Mark
>>>
>>> On 06/10/2008, at 1:49 PM, Tracy12 wrote:
>>>

 Thanks for the reply,

 I have not set any preload value,

 But what I want is capture that event (when someone click the div)
 and do a
 AJAX call to the server, with Preload how can we do this.?

 Do i have to use notifyTopics,


 Waiting for a reply,

 Thanks






 Mark-413 wrote:
>
> What have you set for the "preload" value of the DIV tag?  I  
> believe
> if you set this to false, it will behave the way you want.
>
> Check out: http://struts.apache.org/2.1.2/docs/dojo-div.html
>
> Mark
>
> On 06/10/2008, at 12:22 PM, tom tom wrote:
>
>> Hi,
>>
>> We are using struts 2.0.6 with AJAX development features, we got
>> couple of >  .
>>
>> We want to do some lazy loading, which means when someone clicks
>> the div,
>> inside the tabbed panel,we need to load some data for that
>> corresponding page,
>>
>> At the moment we are unable to trap this event, when we give
>> onClick inside the > one
>> click the div but the page body,which is not we really want.
>>
>> Can someone pls give us any help on this.
>>
>> Thanks
>>
>>
>>
>>
>>
>>
>>
>> -- 
>> --
>> -
>> 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]
>
>
>

 -- 
 View this message in context: http://www.nabble.com/How-to-capture-
 this-event-tp19830839p19831303.html
 Sent from the Struts - User mailing list archive at Nabble.com.


  
 -
 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]
>>>
>>>
>>>
>>
>> -- 
>> View this message in context: http://www.nabble.com/How-to-capture- 
>> this-event-tp19830839p19849519.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-capture-this-event-tp19830839p19870563.html
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: Using POSIX Regular Expressions for Internationalized Validation

2008-10-07 Thread egetchell

That’s an interesting approach you guys are proposing.  

I did a quick proof of concept where I coded an Interceptor that uses the
Apache Commons StringEscapeUtils.escapeHtml function to update all incoming
parameter values.  This seems to implement what you guys suggested.  

What is your approach for then displaying this data?  For example, in my
proof of concept, when I escape Japanese Shift-JIS input, the escaped values
are persisted to the database, and rendered to the browser in the escaped
format.  Do you unescape the prior to persisting it data (as it did pass
validation), or do you have special logic in the actions that will unescape
all properties prior to the JSP page rendering the data? 

Eric


Laurie Harper wrote:
> 
> The validation strategy you cite is well and good when the you *have* 'a 
> set of tightly constrained known good values.' It's not useful in the 
> general case.
> 
> Your concerns with respect to XSS should only present a problem if you 
> need to render untrusted HTML (such as is often the case with web-base 
> email applications, for example). Unless you need to preserve 
> user-submitted HTML, though, the correct answer is, as Greg said, to 
> HTML-escape all user supplied data (or at least, all user supplied data 
> you haven't previously sanitized via strategies such as you referenced).
> 
> If you do that, the browser will never see anything harmful in a context 
> it will treat as anything other than text (i.e. it will never try to 
> interpret such data as markup) and therefore you wont be vulnerable.
> 
> L.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-POSIX-Regular-Expressions-for-Internationalized-Validation-tp19844314p19866354.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



WebBeans vs Spring

2008-10-07 Thread Frans Thamura
hi all

there is a discussion of Spring in our mailing list, and we got that
because of spring security policy, there is a new hot topic, WebBeans

i dont know WebBean, but our fellow just migrate spring to WebBean

can we use Webbeans as S2 ioc?

thx

-- 
-- 
Frans Thamura
Meruvian
One Stop Java and Enterprise OSS Provider
Technopreneurship, Training, Internship, Outsourcing and Corporate
Competency Center

Mobile: +62 855 7888 699
Blog & Profile: http://frans.thamura.info

Training JENI, Medallion (Alfresco, Liferay dan Compiere).. buruan...
URL: 
http://nagasakti.mervpolis.com/roller/mervnews/entry/jeni_training_compiere_dan_alfresco

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



Re: Returning text/html InputStream using Zero Configuration annotations

2008-10-07 Thread 928572663

Awesome it's working now!   Thanks to you both for your help.

For posterity's sake,  here is the working code:


import java.io.InputStream;
import java.io.StringBufferInputStream;

import org.apache.struts2.config.Result;
import org.apache.struts2.dispatcher.StreamResult;

import com.opensymphony.xwork2.ActionSupport;

@Result(name = ActionSupport.SUCCESS, value = "inputStream", type = 
StreamResult.class, params =

{
   "contentType",
   "text/html",
   "inputName",
   "inputStream"
})
public class TextResult extends ActionSupport
{
   private InputStream inputStream;

   public InputStream getInputStream()
   {
  return inputStream;
   }

   public String execute() throws Exception
   {
  inputStream = new StringBufferInputStream(
 "Hello World! This is a text string response from a Struts 2 
Action.");

  return SUCCESS;
   }
}



Thanks,
John

Laurie Harper wrote:

Lukasz Lenart wrote:

2008/10/7 928572663 <[EMAIL PROTECTED]>:

Sorry I forgot to add this:

If I change the value="" to value="John",  the error message changes to
this:


try value="inputName"


Based on the code in the original post, that should be value="inputStream".

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: Problem with mapping Struts action on complex URLs

2008-10-07 Thread Daniele Development-ML
The segment of the Struts config is:








I'll give a look at Antonio's pointer too.

Thanks,

Dan

On Tue, Oct 7, 2008 at 6:27 PM, Dave Newton <[EMAIL PROTECTED]> wrote:

> --- On Tue, 10/7/08, Daniele Development-ML wrote:
> > I am changing the URL action mapping from a simple one (1)
> > "/" to a more complex
> > "//"
> > (2) but when I am navigating the web site, I got the following
> > exception.
> >
> > It is very peculiar since it works fine when the URL is
> > simple (case 1). Indeed, beside any possible missing
> > reference (I double checked though), I cannot even access
> > the action directly.
>
> Without seeing the mapping/configuration you're using it's kinda hard to
> say what might be wrong.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Struts2 Data Transfer

2008-10-07 Thread Dave Newton
--- On Tue, 10/7/08, aum strut wrote:
> i need to transfer data from the user registration page to
> the java beans to be used for inserting values in the data base.
> i have created two seperate beans for this 1) for storing user
> address field and second is for storing user login information.
> 
> i want that when user cllick on the REgister button these
> two Beans get filled with the respective  values from the UI. 
> i have named the corresponding fields in the beans with respect 
> to the fields name in the UI.

What, precisely, is the issue?

If you have a form containing:




each bean will contain whatever was entered in the form.

Dave


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



Re: Problem with mapping Struts action on complex URLs

2008-10-07 Thread Dave Newton
--- On Tue, 10/7/08, Daniele Development-ML wrote:
> I am changing the URL action mapping from a simple one (1)
> "/" to a more complex
> "//"
> (2) but when I am navigating the web site, I got the following 
> exception.
> 
> It is very peculiar since it works fine when the URL is
> simple (case 1). Indeed, beside any possible missing 
> reference (I double checked though), I cannot even access
> the action directly.

Without seeing the mapping/configuration you're using it's kinda hard to say 
what might be wrong.

Dave


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



Re: Problem with mapping Struts action on complex URLs

2008-10-07 Thread Antonio Petrelli
2008/10/7 Daniele Development-ML <[EMAIL PROTECTED]>:
> Hello everybody,
> I am changing the URL action mapping from a simple one (1)
> "/" to a more complex
> "//" (2) but when I am navigating the
> web site, I got the following exception.

I suppose that you are using Struts 1.
Are you using Struts modules?
http://struts.apache.org/1.3.8/userGuide/configuration.html#dd_config_modules

> java.lang.IllegalStateException
> ...
> org.apache.jsp.WEB_002dINF.pages.mainMenu_jsp._jspx_meth_c_005fimport_005f1(mainMenu_jsp.java:279)

I suppose that there is a problem in your "mainMenu.jsp" file, that is
not related to your path structure.

Antonio

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



Re: Portlet Render Question if more than one Struts Portlet is involved - Loosing State

2008-10-07 Thread Nils-Helge Garli Hegvik
It's hard to say without seeing some code and configuration files. The
only difference I can think of is with the actualy deployment process
for each container. There are potentially several different
configuration files depending on the server you're deploying in. It's
a while since I've looked at Liferay, but could it be that the two
deployments refer to the same portlet instance or something? Or maybe,
since the rendering phase appears to have "gone", it's a caching
issue?

Nils-H

On Tue, Oct 7, 2008 at 7:10 PM, Torsten Krah
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> maybe a little bit OT but maybe its struts related, don't know yet.
> I've got two portlets written with struts2 2.0.11.2.
> I've create a page and did both of them onto it.
>
> Lets say Portlet 1 got "Step 1 and Step 2" and Portlet 2 too.
>
> Pluto:
>
> I click on the button to go to Step 2 of Portlet 1.
>
> Result:
> Portlet 1 is in Step 2.
> Portlet 2 is still in initial Step 1 state.
>
> Than i click on the button in Portlet 2 to go to Step 2.
>
> Result:
> Portlet 1 is still in Step 2 (good).
> Portlet 2 is now in Step 2.
>
> debug log show something like this:
>
> 18:50:01,904 DEBUG [org.apache.struts2.portlet.util.PortletUrlHelper]
> Resulting actionPath: /view/mw/mvc/startMaster
> 18:50:01,904 DEBUG [org.apache.struts2.portlet.util.PortletUrlHelper] Creating
> action url
> 18:50:01,906 DEBUG [org.apache.struts2.components.UIBean] Rendering
> template /template/simple/form-close
> 18:50:01,907 DEBUG
> [org.apache.struts2.components.template.FreemarkerTemplateEngine] Rendering
> template /template/simple/form-close.ftl
> 18:50:01,909 DEBUG [org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher]
> Leaving render
> 18:50:01,914 DEBUG [org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher]
> Entering render
> 18:50:01,915 DEBUG [org.apache.struts2.portlet.PortletRequestMap] Dumping
> request parameters:
>
>
> The same stuff in Liferay:
>
> I click on the button to go to Step 2 of Portlet 1.
>
> Result:
> Portlet 1 is in Step 2.
> Portlet 2 is still in initial Step 1 state.
>
> Than i click on the button in Portlet 2 to go to Step 2.
>
> Result:
> Portlet 1 is now again in initial State - Step 1 (BAD)
> Portlet 2 is now in Step 2.
>
> The log is different:
>
> 18:53:35,912 INFO  [STDOUT] 18:53:35,912 DEBUG
> [org.apache.struts2.portlet.util.PortletUrlHelper] Resulting
> actionPath: /view/mw/mvc/startMaster
> 18:53:35,912 INFO  [STDOUT] 18:53:35,912 DEBUG
> [org.apache.struts2.portlet.util.PortletUrlHelper] Creating action url
> 18:53:35,916 INFO  [STDOUT] 18:53:35,916 DEBUG
> [org.apache.struts2.components.UIBean] Rendering
> template /template/simple/form-close
> 18:53:35,916 INFO  [STDOUT] 18:53:35,916 DEBUG
> [org.apache.struts2.components.template.FreemarkerTemplateEngine] Rendering
> template /template/simple/form-close.ftl
> 18:53:35,960 INFO  [STDOUT] 18:53:35,960 DEBUG
> [org.apache.struts2.portlet.PortletRequestMap] Dumping request parameters:
>
>
> The "Leaving Render" and "Entering Render" is gone @Liferay.
>
> Whats the correct behaviour, i thought what pluto does is right, isn't it?
> Does anyone know why this may happen, or does anyone have an idea why those
> containers behave different and how it can be fixed?
>
> thx
>
> --
> Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
> Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html
>
> Really, I'm not out to destroy Microsoft. That will just be a
> completely unintentional side effect."
>-- Linus Torvalds
>

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



Portlet Render Question if more than one Struts Portlet is involved - Loosing State

2008-10-07 Thread Torsten Krah
Hi,

maybe a little bit OT but maybe its struts related, don't know yet.
I've got two portlets written with struts2 2.0.11.2.
I've create a page and did both of them onto it.

Lets say Portlet 1 got "Step 1 and Step 2" and Portlet 2 too.

Pluto:

I click on the button to go to Step 2 of Portlet 1.

Result:
Portlet 1 is in Step 2.
Portlet 2 is still in initial Step 1 state.

Than i click on the button in Portlet 2 to go to Step 2.

Result:
Portlet 1 is still in Step 2 (good).
Portlet 2 is now in Step 2.

debug log show something like this:

18:50:01,904 DEBUG [org.apache.struts2.portlet.util.PortletUrlHelper] 
Resulting actionPath: /view/mw/mvc/startMaster
18:50:01,904 DEBUG [org.apache.struts2.portlet.util.PortletUrlHelper] Creating 
action url
18:50:01,906 DEBUG [org.apache.struts2.components.UIBean] Rendering 
template /template/simple/form-close
18:50:01,907 DEBUG 
[org.apache.struts2.components.template.FreemarkerTemplateEngine] Rendering 
template /template/simple/form-close.ftl
18:50:01,909 DEBUG [org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher] 
Leaving render
18:50:01,914 DEBUG [org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher] 
Entering render
18:50:01,915 DEBUG [org.apache.struts2.portlet.PortletRequestMap] Dumping 
request parameters: 


The same stuff in Liferay:

I click on the button to go to Step 2 of Portlet 1.

Result:
Portlet 1 is in Step 2.
Portlet 2 is still in initial Step 1 state.

Than i click on the button in Portlet 2 to go to Step 2.

Result:
Portlet 1 is now again in initial State - Step 1 (BAD)
Portlet 2 is now in Step 2.

The log is different:

18:53:35,912 INFO  [STDOUT] 18:53:35,912 DEBUG 
[org.apache.struts2.portlet.util.PortletUrlHelper] Resulting 
actionPath: /view/mw/mvc/startMaster
18:53:35,912 INFO  [STDOUT] 18:53:35,912 DEBUG 
[org.apache.struts2.portlet.util.PortletUrlHelper] Creating action url
18:53:35,916 INFO  [STDOUT] 18:53:35,916 DEBUG 
[org.apache.struts2.components.UIBean] Rendering 
template /template/simple/form-close
18:53:35,916 INFO  [STDOUT] 18:53:35,916 DEBUG 
[org.apache.struts2.components.template.FreemarkerTemplateEngine] Rendering 
template /template/simple/form-close.ftl
18:53:35,960 INFO  [STDOUT] 18:53:35,960 DEBUG 
[org.apache.struts2.portlet.PortletRequestMap] Dumping request parameters: 


The "Leaving Render" and "Entering Render" is gone @Liferay.

Whats the correct behaviour, i thought what pluto does is right, isn't it?
Does anyone know why this may happen, or does anyone have an idea why those 
containers behave different and how it can be fixed?

thx

-- 
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html

Really, I'm not out to destroy Microsoft. That will just be a 
completely unintentional side effect."
-- Linus Torvalds


smime.p7s
Description: S/MIME cryptographic signature


Problem with mapping Struts action on complex URLs

2008-10-07 Thread Daniele Development-ML
Hello everybody,
I am changing the URL action mapping from a simple one (1)
"/" to a more complex
"//" (2) but when I am navigating the
web site, I got the following exception.

It is very peculiar since it works fine when the URL is simple (case 1).
Indeed, beside any possible missing reference (I double checked though), I
cannot even access the action directly.

I am sure it's something trivial but I can't really get around this.

Any hint?

Thanks a lot!


07-Oct-2008 17:37:47 org.apache.catalina.core.ApplicationDispatcher invoke
java.lang.IllegalStateException
at
org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407)
at
org.netbeans.modules.web.monitor.server.MonitorResponseWrapper.sendError(MonitorResponseWrapper.java:149)
at
javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:108)
at
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:662)
at
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:325)
at
org.apache.catalina.servlets.DefaultServlet.doPost(DefaultServlet.java:361)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at
org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:296)
at
org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161)
at
org.apache.jsp.WEB_002dINF.pages.mainMenu_jsp._jspx_meth_c_005fimport_005f1(mainMenu_jsp.java:279)
at
org.apache.jsp.WEB_002dINF.pages.mainMenu_jsp._jspService(mainMenu_jsp.java:98)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
at
org.apache.struts.action.RequestProcessor.doInclude(RequestProcessor.java:1116)
at
org.apache.struts.action.RequestProcessor.internalModuleRelativeInclude(RequestProcessor.java:1054)
at
org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeInclude(TilesRequestProcessor.java:369)
at
org.apache.struts.action.RequestProcessor.processInclude(RequestProcessor.java:598)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:225)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter

Struts2 Data Transfer

2008-10-07 Thread aum strut
Hi All,

Sorry if i am asking a very basic question.

i need to transfer data from the user registration page to the java beans to
be used for inserting values in the data base.
i have created two seperate beans for this
1) for storing user address field and second is for storing user login
information.

i want that when user cllick on the REgister button these two Beans get
filled with the respective  values from the UI. i have named the
corresponding fields in the beans with respect to the fields name in the UI.

currently i am using struts 2.0.11

how can i fill these two beans at a same time so that my action class can
use these two beans classes for the registration Logic.

i have the idea of using ModelDriven Action but how can intianilised these
two beans at same time any pointer in this regard will be much appriciated.

Thanks in advance
-aum


Re: Returning text/html InputStream using Zero Configuration annotations

2008-10-07 Thread Laurie Harper

Lukasz Lenart wrote:

2008/10/7 928572663 <[EMAIL PROTECTED]>:

Sorry I forgot to add this:

If I change the value="" to value="John",  the error message changes to
this:


try value="inputName"


Based on the code in the original post, that should be value="inputStream".

L.


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



Re: Using POSIX Regular Expressions for Internationalized Validation

2008-10-07 Thread Laurie Harper
The validation strategy you cite is well and good when the you *have* 'a 
set of tightly constrained known good values.' It's not useful in the 
general case.


Your concerns with respect to XSS should only present a problem if you 
need to render untrusted HTML (such as is often the case with web-base 
email applications, for example). Unless you need to preserve 
user-submitted HTML, though, the correct answer is, as Greg said, to 
HTML-escape all user supplied data (or at least, all user supplied data 
you haven't previously sanitized via strategies such as you referenced).


If you do that, the browser will never see anything harmful in a context 
it will treat as anything other than text (i.e. it will never try to 
interpret such data as markup) and therefore you wont be vulnerable.


L.

egetchell wrote:

Greg,

Thanks for the reply.

The common approach for mitigating XSS is to provide a blacklist of XSS
enabling characters, enables would include "<", ">", "%3f", etc.  However,
these filters are easily bypassed by clever encoding constructs, so the
blacklist concept quickly fails and the site is open for attack.  


By inverting the solution and supplying only the allowed set of characters,
the site remains secure no matter what clever encoding scheme someone dreams
up.  

The OWASP group provides some pretty extensive documentation around this. 
Here is a direct link to some common validation strategies:

http://www.owasp.org/index.php/Data_Validation#Data_Validation_Strategies

Their document, as a whole, is a very intereseting read.


Greg Lindholm wrote:

Sorry, I've never heard of whitelisting of allowable characters as being a
"normal" approach.  






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



Re: Using POSIX Regular Expressions for Internationalized Validation

2008-10-07 Thread Greg Lindholm

I can see that approach may work for certain restrictive fields like their
postal code example but as you are finding it's pretty unworkable in
multi-language unicode applications.  I've always had to deal with input
fields for notes, comments, descriptions etc. where there are no
restrictions and special html characters like '<', '>' are allowed, with
these you have no choice but to escape properly.  

If you want to validate in Java you can use Character.isLetter(),
Character.isDigit(), or org.apache.commons.lang.StringUtils, etc. and these
work for all the unicode languages, but trying to do this with declarative
validation using Regular Expressions... good luck.



egetchell wrote:
> 
> Greg,
> 
> Thanks for the reply.
> 
> The common approach for mitigating XSS is to provide a blacklist of XSS
> enabling characters, enables would include "<", ">", "%3f", etc.  However,
> these filters are easily bypassed by clever encoding constructs, so the
> blacklist concept quickly fails and the site is open for attack.  
> 
> By inverting the solution and supplying only the allowed set of
> characters, the site remains secure no matter what clever encoding scheme
> someone dreams up.  
> 
> The OWASP group provides some pretty extensive documentation around this. 
> Here is a direct link to some common validation strategies:
> http://www.owasp.org/index.php/Data_Validation#Data_Validation_Strategies
> 
> Their document, as a whole, is a very intereseting read.
> 
> 
> Greg Lindholm wrote:
>> 
>> Sorry, I've never heard of whitelisting of allowable characters as being
>> a "normal" approach.  
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-POSIX-Regular-Expressions-for-Internationalized-Validation-tp19844314p19861490.html
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: SV: SV: Ognl versions

2008-10-07 Thread Dale Newfield

[EMAIL PROTECTED] wrote:

We have a measureList that looks the same and it works!


It's not quite the same, since it's capitalization is correct.


   public SortedMap getMeasureList() {


Chris Pratt wrote:
Just as an experiment, you might try renaming the method as a 
true JavaBean method.  Maybe OGNL got more strict on it's 
interpretation of the spec.


The renaming he's mentioning is from getjobTypeList to getJobTypeList :


   public SortedMap getjobTypeList() {


And my apologies for misunderstanding your comment about it being null.

-Dale

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



Re: Returning text/html InputStream using Zero Configuration annotations

2008-10-07 Thread Lukasz Lenart
2008/10/7 928572663 <[EMAIL PROTECTED]>:
> Sorry I forgot to add this:
>
> If I change the value="" to value="John",  the error message changes to
> this:

try value="inputName"


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



SV: SV: Ognl versions

2008-10-07 Thread Gunnar.Bostrom
Hi,
We have a measureList that looks the same and it works!
   public SortedMap getMeasureList() {

// man = Ärenden som skall konfigureras manuellt
// uttagen = Ärenden som skall klarrapporteras efter manuell 
konfigurering
measureList.put(1, "Ärenden som skall konfigureras manuellt");
measureList.put(2, "Ärenden som skall klarrapporteras efter manuell 
konfigurering");

return measureList;
}



/Gunnar
 

> -Ursprungligt meddelande-
> Från: Chris Pratt [mailto:[EMAIL PROTECTED] 
> Skickat: den 7 oktober 2008 09:15
> Till: Struts Users Mailing List
> Ämne: Re: SV: Ognl versions
> 
> Just as an experiment, you might try renaming the method as a 
> true JavaBean method.  Maybe OGNL got more strict on it's 
> interpretation of the spec.
>   (*Chris*)
> 
> On Mon, Oct 6, 2008 at 11:21 PM, 
> <[EMAIL PROTECTED]> wrote:
> 
> > Hi,
> > I mean that the value is null now that I use ognl 2.7.2. When using 
> > 2.6.11 the value is a correct map.
> >
> > This is in the model för the jsp page:
> >SortedMap jobTypeList = new TreeMap > String>();
> >
> >public SortedMap getjobTypeList() {
> >jobTypeList.put(1, "Förfrågan");
> >jobTypeList.put(8, "VP-flytt");
> >// return this.getWc().getTypeAsText();
> >return jobTypeList;
> >}
> >
> > /Gunnar
> >
> >
> > > -Ursprungligt meddelande-
> > > Från: Dale Newfield [mailto:[EMAIL PROTECTED]
> > > Skickat: den 6 oktober 2008 20:34
> > > Till: Bostrom Gunnar
> > > Kopia: user@struts.apache.org
> > > Ämne: Re: SV: Ognl versions
> > >
> > > [EMAIL PROTECTED] wrote:
> > > > The jobTypelist is empty, but it worked with 2.6.11 
> version of ognl.
> > > > The applications is our own.
> > >
> > > So you're saying that the updated version doesn't 
> silently fail, and 
> > > that's enough to condemn it?  I would argue that that's an 
> > > improvement.
> > >
> > > In fact, if you look in the source code for the exception 
> stack you 
> > > provide, this is by design:
> > >
> > > core/src/main/java/org/apache/struts2/components/ListUIBean.java:
> > > > if (value == null) {
> > > > if (throwExceptionOnNullValueAttribute) {
> > > > // will throw an exception if not found
> > > > value = findValue((list == null) ? (String)
> > > list : list.toString(), "list",
> > > > "The requested list key '" + list + "'
> > > could not be resolved as a
> > > collection/array/map/enumeration/iterator type. " +
> > > > "Example: people or people.{name}");
> > > > }
> > > > else {
> > > > // ww-1010, allows value with null value to
> > > be compatible with ww
> > > > // 2.1.7 behaviour
> > > > value = findValue((list == null)?(String)
> > > list:list.toString());
> > > > }
> > >  > }
> > >
> > > So, in fact, what you're finding through your testing is a place 
> > > where ognl 2.6.11 is doing the wrong thing.
> > >
> > > If you want silent failure, there's a flag to throw so 
> that your app 
> > > gets it.  If you want to evaluate the correctness of a component, 
> > > please ensure you're testing what you think you're testing.
> > >
> > > -Dale
> > >
> >
> > 
> -
> > 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: Using POSIX Regular Expressions for Internationalized Validation

2008-10-07 Thread egetchell

Greg,

Thanks for the reply.

The common approach for mitigating XSS is to provide a blacklist of XSS
enabling characters, enables would include "<", ">", "%3f", etc.  However,
these filters are easily bypassed by clever encoding constructs, so the
blacklist concept quickly fails and the site is open for attack.  

By inverting the solution and supplying only the allowed set of characters,
the site remains secure no matter what clever encoding scheme someone dreams
up.  

The OWASP group provides some pretty extensive documentation around this. 
Here is a direct link to some common validation strategies:
http://www.owasp.org/index.php/Data_Validation#Data_Validation_Strategies

Their document, as a whole, is a very intereseting read.


Greg Lindholm wrote:
> 
> Sorry, I've never heard of whitelisting of allowable characters as being a
> "normal" approach.  
> 

-- 
View this message in context: 
http://www.nabble.com/Using-POSIX-Regular-Expressions-for-Internationalized-Validation-tp19844314p19859522.html
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: Returning text/html InputStream using Zero Configuration annotations

2008-10-07 Thread 928572663

Sorry I forgot to add this:

If I change the value="" to value="John",  the error message changes to 
this:


ERROR dispatcher.StreamResult  - Can not find a java.io.InputStream with 
the name [John] in the invocation stack. Check the name="inputName"> tag specified for this action.


It appears that it is attempting to process the forward,  but is not 
able to locate the stream.  Does it need an OGNL trick in the "value" 
field to help it call my getInputStream() accessor?



Thanks,
John

928572663 wrote:

Lukasz,

Thank you for your reply.

I tried adding the name="success"  (or ActionSupport.SUCCESS) and I get 
the same error.   Here is the annotation now:


@Result(name="success", value = "", type = StreamResult.class, params =
{
   "contentType",
   "text/html",
   "inputName",
   "inputStream" })

also tried:

@Result(name=ActionSupport.SUCCESS, value = "", type = 
StreamResult.class, params =

{
   "contentType",
   "text/html",
   "inputName",
   "inputStream" })

and received the same error:

ERROR dispatcher.StreamResult  - Can not find a java.io.InputStream with 
the name [] in the invocation stack. Check the  
tag specified for this action.


Any other ideas?

Thanks,
John





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



Re: howto cache the textfield

2008-10-07 Thread Paweł Wielgus
Hi,
you can create ajax action that will call your application and ask for
the last entered values for field myField.
But it would require to remember all entered values by users.
When you will have those values You can simply do something like google suggest.
I haven't done anything like that, so i cant be more specific,
it's just a matter of remebering entered values per field and using
ajax to grab them.

Best greetings,
Paweł Wielgus.


2008/10/7 xianwinwin <[EMAIL PROTECTED]>:
>
> Hi Pawel,
> thank you for your reply.  You mentioned: "But You can achieve the same by
> adding ajax to this field" how can I achieve that?
> Thank you!
>
>
>
> Paweł Wielgus wrote:
>>
>> Hi xianwinwin,
>> it's a firefox feature - remember entered form values or something like
>> this,
>> so yes it has nothing to do with struts.
>> But You can achieve the same by adding ajax to this field
>> and remembering all posted data in Your app.
>>
>> Best greetings,
>> Paweł Wielgus.
>>
>> 2008/10/6 xianwinwin <[EMAIL PROTECTED]>:
>>>
>>> I have a textfield where a user input information.
>>>
>>>
>>> >> label="Destination"
>>> required="false"size="15"   />
>>>
>>> My question is this: how can I give the user previous input that he
>>> provided
>>> once he clicks the textfield; in other word, when he clicks (or double
>>> click) the textfield he can see (in a drop down box) what he entered
>>> before.
>>>
>>> for some reason, this works for some textfields and for some it doesn't
>>> (I
>>> guess it's not a struts issue).
>>> but still I wonder how to do that.
>>>
>>> thank you!
>>> --
>>> View this message in context:
>>> http://www.nabble.com/howto-cache-the-textfield-tp19844989p19844989.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/howto-cache-the-textfield-tp19844989p19858526.html
> 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: Returning text/html InputStream using Zero Configuration annotations

2008-10-07 Thread 928572663

Lukasz,

Thank you for your reply.

I tried adding the name="success"  (or ActionSupport.SUCCESS) and I get 
the same error.   Here is the annotation now:


@Result(name="success", value = "", type = StreamResult.class, params =
{
   "contentType",
   "text/html",
   "inputName",
   "inputStream" })

also tried:

@Result(name=ActionSupport.SUCCESS, value = "", type = 
StreamResult.class, params =

{
   "contentType",
   "text/html",
   "inputName",
   "inputStream" })

and received the same error:

ERROR dispatcher.StreamResult  - Can not find a java.io.InputStream with 
the name [] in the invocation stack. Check the  
tag specified for this action.


Any other ideas?

Thanks,
John


Lukasz Lenart wrote:

@Result(value = "", type = StreamResult.class, params =


You are missing Result Name, please specify it as a *success*

http://struts.apache.org/2.0.11.2/docs/result-annotation.html


Regards



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



Re: howto cache the textfield

2008-10-07 Thread xianwinwin

Hi Pawel,
thank you for your reply.  You mentioned: "But You can achieve the same by
adding ajax to this field" how can I achieve that? 
Thank you!



Paweł Wielgus wrote:
> 
> Hi xianwinwin,
> it's a firefox feature - remember entered form values or something like
> this,
> so yes it has nothing to do with struts.
> But You can achieve the same by adding ajax to this field
> and remembering all posted data in Your app.
> 
> Best greetings,
> Paweł Wielgus.
> 
> 2008/10/6 xianwinwin <[EMAIL PROTECTED]>:
>>
>> I have a textfield where a user input information.
>>
>>
>> > label="Destination"
>> required="false"size="15"   />
>>
>> My question is this: how can I give the user previous input that he
>> provided
>> once he clicks the textfield; in other word, when he clicks (or double
>> click) the textfield he can see (in a drop down box) what he entered
>> before.
>>
>> for some reason, this works for some textfields and for some it doesn't
>> (I
>> guess it's not a struts issue).
>> but still I wonder how to do that.
>>
>> thank you!
>> --
>> View this message in context:
>> http://www.nabble.com/howto-cache-the-textfield-tp19844989p19844989.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/howto-cache-the-textfield-tp19844989p19858526.html
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 call javascript function on onload in struts-tiles

2008-10-07 Thread Dave Newton
--- On Tue, 10/7/08, Sulabha Walavalkar wrote:
> I have a requirement as - on click of submit button call
> should be made to database to check if any batch processes 
> are running or not.
> 
> If any batch process is running then a message should be
> displayed on the same screen else the data should be displayed 
> in new window.
> 
> Since I am using tiles and layout.jsp page, 
> tag contains in layout.jsp.  How can I check the value set 
> by action class in javascript function on onLoad event and 
> then decide whether to open new window or stay on the same screen?

Personally I'd use Ajax to solve this, as a static version wouldn't be 
particularly accurate.

A trivial solution would be to set a JavaScript variable to the value of some 
action variable; this is done inside a JSP:


  var foo = ;
  function checkOnSubmit() {
  if (foo) {
  // When running
  } else {
  // Not running
  }
  }


Dave

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



Re: How to call javascript function on onload in struts-tiles

2008-10-07 Thread Alberto Flores

Use validation

Sulabha Walavalkar wrote:

Hi,

 


I have a requirement as - on click of submit button call should be made to
database to check if any batch processes are running or not.

If any batch process is running then a message should be displayed on the
same screen else the data should be displayed in new window.

 


Since I am using tiles and layout.jsp page,  tag contains in
layout.jsp.  How can I check the value set by action class in javascript
function on onLoad event and then decide whether to open new window or stay
on the same screen?

 


If anyone has come across this situation or have any idea, please reply.

 


Thanks & Regards,
Sulabha Walavalkar


John Lewis Partnership, Zensar Technologies 
Zensar Knowledge Park, Plot#4, MIDC, 
Kharadi, Off Nagar Road, Pune - 411014

Landline :  +91-20-66074888   | +91-9765204544

 


Email  :   [EMAIL PROTECTED]| website:  www.zensar.com
 

 





--
--
Alberto
http://www.linkedin.com/in/aflores

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

Re: Using POSIX Regular Expressions for Internationalized Validation

2008-10-07 Thread Greg Lindholm

Sorry, I've never heard of whitelisting of allowable characters as being a
"normal" approach. 
I've developed many multi-language web applications, some with Struts (1 &
2) and some without. 
Typically you have to watch for 2 things; 1) when re-displaying anything a
user has entered you need to ensure it is properly escaped for html, the
Struts  tag nicely takes care of this for you. 2) prevent SQL
injection by using compiled parametrized SQL statements (like Hibernate will
do for you.) 


egetchell wrote:
> 
> All,
> 
> I am one of the architects behind a multi-language site using Struts 2. 
> To mitigate XSS exposure, defining a whitelist of allowable characters is
> the normal approach, but seems to become a non-trivial exercise when
> supporting multiple languages (we will be supporting 15).  My
> understanding is using POSIX based regular expressions allow combining
> language-specific character sets in a single regular expression.  This is
> my first foray into the subject of multi-language validation, so I
> apologize in advance if this is not the correct forum for these two
> questions:
> 
> First, does Struts 2 support POSIX regular expressions?  I’ve tried a
> bunch of attempts to just get a simple example working and have had little
> luck.  From my research, I believe the following is expected to work:
> 
> 
>   
> 
>   
>   Invalid Field
> 
> 
> Secondly, as a more general (and possibly non-Struts2 specific question),
> has anyone had experience in implementing multi-language whitelists?  The
> information on the Internet is quite vague, so I’m not sure if this is
> still a black art making people a bit more close-lipped on the subject.
> 
> Thanks!
> 
> Eric Getchell | Sr. Technologist
> 
> Distributed Logic Corporation
> 600 Unicorn Park
> Woburn, MA 01801
> Email: [EMAIL PROTECTED]
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Using-POSIX-Regular-Expressions-for-Internationalized-Validation-tp19844314p19858027.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



How to call javascript function on onload in struts-tiles

2008-10-07 Thread Sulabha Walavalkar
Hi,

 

I have a requirement as - on click of submit button call should be made to
database to check if any batch processes are running or not.

If any batch process is running then a message should be displayed on the
same screen else the data should be displayed in new window.

 

Since I am using tiles and layout.jsp page,  tag contains in
layout.jsp.  How can I check the value set by action class in javascript
function on onLoad event and then decide whether to open new window or stay
on the same screen?

 

If anyone has come across this situation or have any idea, please reply.

 

Thanks & Regards,
Sulabha Walavalkar


John Lewis Partnership, Zensar Technologies 
Zensar Knowledge Park, Plot#4, MIDC, 
Kharadi, Off Nagar Road, Pune - 411014
Landline :  +91-20-66074888   | +91-9765204544

 

Email  :   [EMAIL PROTECTED]| website:  www.zensar.com
 

 



Re: hw to use if tag

2008-10-07 Thread Dave Newton
The "var" attribute is Struts 2.1, use "id" if you're using Struts 2.0.

Dave

--- On Tue, 10/7/08, Hardik Shah <[EMAIL PROTECTED]> wrote:
> when i write 
> 
> my all values are note printed
> 
> it means each record has attrMatrixValue vector 
> but in it not each has value
> 
> so i have to apply condition for the property of
> attrMatrixValue 
> 
> help me,
> and  var="iterator"> 
> gives as it has no such thing like var(using struts
> 2.0.11.2)
> 
> 
> 
> 
> 
> 
> Sébastien Domergue wrote:
> > 
> > Hi,
> > 
> > in your test condition, struts doesn't understand
> that attrMatrixValue 
> > is a property, you should write something like :
> > 
> > Using '%{' means that the expression have to
> be evaluated.
> > 
> > Regards
> > 
> > Sébastien
> > 
> > Hardik Shah a écrit :
> >> hi
> >>
> >> i have vector of vector and i can easily iterate
> using   in
> >> between 
> >>
> >> but the problem is that some of the element in
> vector of vector is null
> >>
> >> like
> >> 
> >>  id="attriblist">
> >> 
> >>  value="attrName"/>
> >>  value="attrValue"/>
> >>  value="attrType"/>
> >>  value="attrForIndiName"/>
> >>  value="userTypeName"/>
> >>  value="userInput"/>
> >>  value="remark"/>
> >> 
> >> <%int srno=1; %>
> >>
> >>
> >>  value="attrMatrixValue">
> >> 
> >> <%=srno++ %>
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> <%srno=1; %>
> >>
> >> -
> >> how i can put condition for that i am not good in
> ognl
> >>
> >> please help me
> >>
> >>   
> > 
> > 
> >
> -
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/hw-to-use-if-tag-tp19856372p19857035.html
> Sent from the Struts - User mailing list archive at
> Nabble.com.
> 
> 
> -
> 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: hw to use if tag

2008-10-07 Thread Sébastien Domergue
Is your vector just a vector of value or is it an object vector with 
attribute fields? With attribute fields you should use the if tag as 
described before. In the other case, you have to use the var field of 
 that would create a variable to manipulate the value.


regards

Hardik Shah a écrit :

when i write 

my all values are note printed

it means each record has attrMatrixValue vector 
but in it not each has value


so i have to apply condition for the property of attrMatrixValue 


help me,
and  
gives as it has no such thing like var(using struts 2.0.11.2)







Sébastien Domergue wrote:
  

Hi,

in your test condition, struts doesn't understand that attrMatrixValue 
is a property, you should write something like :


Using '%{' means that the expression have to be evaluated.

Regards

Sébastien

Hardik Shah a écrit :


hi

i have vector of vector and i can easily iterate using   in
between 

but the problem is that some of the element in vector of vector is null

like



 







<%int srno=1; %>




<%=srno++ %>










<%srno=1; %>

-
how i can put condition for that i am not good in ognl

please help me

  
  

-
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: hw to use if tag

2008-10-07 Thread Hardik Shah

when i write 

my all values are note printed

it means each record has attrMatrixValue vector 
but in it not each has value

so i have to apply condition for the property of attrMatrixValue 

help me,
and  
gives as it has no such thing like var(using struts 2.0.11.2)






Sébastien Domergue wrote:
> 
> Hi,
> 
> in your test condition, struts doesn't understand that attrMatrixValue 
> is a property, you should write something like :
> 
> Using '%{' means that the expression have to be evaluated.
> 
> Regards
> 
> Sébastien
> 
> Hardik Shah a écrit :
>> hi
>>
>> i have vector of vector and i can easily iterate using   in
>> between 
>>
>> but the problem is that some of the element in vector of vector is null
>>
>> like
>> 
>> 
>> 
>>   
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> <%int srno=1; %>
>>  
>>  
>> 
>> 
>> <%=srno++ %>
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> <%srno=1; %>
>>  
>> -
>> how i can put condition for that i am not good in ognl
>>
>> please help me
>>
>>   
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
View this message in context: 
http://www.nabble.com/hw-to-use-if-tag-tp19856372p19857035.html
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: hw to use if tag

2008-10-07 Thread Paweł Wielgus
Hi,
there is also problem with:

and


it should be something like



Read more about it here:
http://struts.apache.org/2.x/docs/tag-reference.html

Best greetings,
Paweł Wielgus.


2008/10/7 Sébastien Domergue <[EMAIL PROTECTED]>:
> Hi,
>
> in your test condition, struts doesn't understand that attrMatrixValue is a
> property, you should write something like :
> 
> Using '%{' means that the expression have to be evaluated.
>
> Regards
>
> Sébastien
>
> Hardik Shah a écrit :
>>
>> hi
>>
>> i have vector of vector and i can easily iterate using   in
>> between 
>>
>> but the problem is that some of the element in vector of vector is null
>>
>> like
>> 
>> 
>>
>> 
>>
>>
>>
>>
>>
>>
>>
>><%int srno=1; %>
>>
>>
>>
>><%=srno++ %>
>>
>>
>>
>>
>>
>>
>><%srno=1; %>
>>
>> -
>> how i can put condition for that i am not good in ognl
>>
>> please help me
>>
>>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


Re: hw to use if tag

2008-10-07 Thread Sébastien Domergue

Hi,

in your test condition, struts doesn't understand that attrMatrixValue 
is a property, you should write something like :


Using '%{' means that the expression have to be evaluated.

Regards

Sébastien

Hardik Shah a écrit :

hi

i have vector of vector and i can easily iterate using   in
between 

but the problem is that some of the element in vector of vector is null

like



 







<%int srno=1; %>




<%=srno++ %>










<%srno=1; %>

-
how i can put condition for that i am not good in ognl

please help me

  


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

hw to use if tag

2008-10-07 Thread Hardik Shah

hi

i have vector of vector and i can easily iterate using   in
between 

but the problem is that some of the element in vector of vector is null

like



 







<%int srno=1; %>




<%=srno++ %>








<%srno=1; %>

-
how i can put condition for that i am not good in ognl

please help me

-- 
View this message in context: 
http://www.nabble.com/hw-to-use-if-tag-tp19856372p19856372.html
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: Struts 2: Tags

2008-10-07 Thread Mickey Kumra
Hi

I have already been through the Tag Guide. However, there are examples which 
use certain tag attributes which aren't explained in the documentation. Also, 
tips on using ActionError and ActionMessage are absent.




Thanks & Regards

---Mickey Kumra___





-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2008 1:46 AM
To: Struts Users Mailing List
Subject: Re: Struts 2: Tags

Check out: http://struts.apache.org/2.1.2/docs/tag-developers-guide.html
Mark

On 07/10/2008, at 3:49 AM, Mickey Kumra wrote:

>
> Hi
>
> I wish to develop an application from scratch, using Struts 2.
> However, I don't find the tag documentation available on the Apache
> website to be comprehensive. Could somebody please guide me in this
> regard.
>
>
>
>
>
>
>
>
>
>
>
>
> Thanks & Regards
>
> ---Mickey Kumra___
>
>  CAUTION - Disclaimer *
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION
> intended solely
> for the use of the addressee(s). If you are not the intended
> recipient, please
> notify the sender by e-mail and delete the original message.
> Further, you are not
> to copy, disclose, or distribute this e-mail or its contents to any
> other person and
> any such actions are unlawful. This e-mail may contain viruses.
> Infosys has taken
> every reasonable precaution to minimize this risk, but is not
> liable for any damage
> you may sustain as a result of any virus in this e-mail. You should
> carry out your
> own virus checks before opening the e-mail or attachment. Infosys
> reserves the
> right to monitor and review the content of all messages sent to or
> from this e-mail
> address. Messages sent to or from this e-mail address may be stored
> on the
> Infosys e-mail system.
> ***INFOSYS End of Disclaimer INFOSYS***


-
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: Tree default expanded ??

2008-10-07 Thread Narayana S
Hi Jan,

Thanks for your reply, i am using struts 2.1.2, and for testing
i added a simple code like this...

dojo.event.topic.subscribe("tree/treeCreate", function treeCreated(node) {
alert("Tree Loaded");
});

this is not fired after page is loaded. if possible can you give your tree
and div construct also here?



On Tue, Oct 7, 2008 at 4:11 PM, Jan Froehlich
<[EMAIL PROTECTED]>wrote:

> Hi...
>  I think I already posted that code snippet to the list, but here again
> just for you! ;)
> The code expands all nodes in my tree, and preselects a node.
> After all is done, it publishes a topic to notify a sx:div to refresh...
>
> Possibly not the best solution, but working fine for me!
> dojo.event.topic.subscribe("tree/treeCreate", function treeCreated(node) {
>var nodes = dojo.widget.getWidgetsByType("StrutsTreeNode");
>var i;
>for(i=0; i< nodes.length; i++) {
>nodes[i].expand();
>}
>var node = dojo.widget.getWidgetById("<%=
> request.getSession().getAttribute("PreselectedCategory") %>");
>node.expand();
>node.markSelected();
>document.DocumentListSelection.NodeID.value = <%=
> request.getSession().getAttribute("PreselectedCategory") %>;
>dojo.event.topic.publish('ListSelectionFilled');
> });
> Regards
> Jan
>
>
>
> Von: Narayana S
> Gesendet: Di 07.10.2008 12:23
> An: Struts Users Mailing List
> Betreff: Re: Tree default expanded ??
>
>
> Hello.
>
> Please any one tell me a solution to this problem? can we do this
> in struts? if not suggest me another alternative to build tree control!! i
> am kind of stuck with this tree... it is killing me...
>
> On Tue, Oct 7, 2008 at 12:12 PM, Jukka Välimaa <[EMAIL PROTECTED]
> >wrote:
>
> > I don't know. One thing to try might be to run the expansion script after
> > you're sure the tree widget has been rendered.
> > Jukka
> >
> > On Wed, Oct 1, 2008 at 9:19 AM, Narayana S <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hi,
> > >
> > >   Thanks for your reply, i tried this code but it is returning
> > > nodes.length as zero though i have a tree with 1 root and 3 child nodes
> > for
> > > root. this is my code snippet
> > > *tree
> > >
> > > * > > childCollectionProperty="children" nodeIdProperty="fieldID"
> > > nodeTitleProperty="fieldName" treeSelectedTopic="treeSelected"
> > > expandedNotifyTopics="treeExpanded" />
> > >
> > > *javascript*
> > >
> > > 
> > > var nodes =
> > dojo.widget.manager.getWidgetsByType('struts:StrutsTreeNode');
> > > alert("Number of nodes"+nodes.length);
> > > for( var i=0; i < nodes.length; i++){
> > >nodes[i].expand();
> > >}
> > > 
> > >
> > > what is the problem? am i missing anything? please help me to solve
> this
> > > issue.
> > >
> > > On Tue, Sep 30, 2008 at 7:49 PM, Jukka Välimaa <
> [EMAIL PROTECTED]
> > > >wrote:
> > >
> > > > As far as I know, it is not possible to expand tree widget
> server-side.
> > > > Client-side, javascript can be used to open the tree, like so:var
> nodes
> > =
> > > > dojo.widget.manager.getWidgetsByType('struts:StrutsTreeNode');
> > > > for( var i=0; i < nodes.length; i++){
> > > > nodes[i].expand();
> > > > }
> > > >
> > > > Jukka
> > > >
> > > > On Tue, Sep 30, 2008 at 4:59 PM, Narayana S <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > any one who worked on tree control plz give some helping hand
> > > > >
> > > > >
> > > > >
> > > > > On Fri, Sep 26, 2008 at 3:34 PM, Narayana S <
> [EMAIL PROTECTED]>
> > > > > wrote:
> > > > >
> > > > > > Hi
> > > > > >  Is it possible to display a tree expanded by default?
> > > > > > I am using struts 2.1.2 dojo-plugin to create the tree structure.
> > any
> > > > one
> > > > > > used tree...plz help me
> > > > > >
> > > > >
> > > >
> > >
> >
>


AW: Tree default expanded ??

2008-10-07 Thread Jan Froehlich
Hi...
 I think I already posted that code snippet to the list, but here again just 
for you! ;)
The code expands all nodes in my tree, and preselects a node.
After all is done, it publishes a topic to notify a sx:div to refresh...

Possibly not the best solution, but working fine for me!
dojo.event.topic.subscribe("tree/treeCreate", function treeCreated(node) {
var nodes = dojo.widget.getWidgetsByType("StrutsTreeNode");
var i;
for(i=0; i< nodes.length; i++) {
nodes[i].expand();
}
var node = dojo.widget.getWidgetById("<%= 
request.getSession().getAttribute("PreselectedCategory") %>");
node.expand();
node.markSelected();
document.DocumentListSelection.NodeID.value = <%= 
request.getSession().getAttribute("PreselectedCategory") %>;
dojo.event.topic.publish('ListSelectionFilled');
});
Regards
Jan



Von: Narayana S
Gesendet: Di 07.10.2008 12:23
An: Struts Users Mailing List
Betreff: Re: Tree default expanded ??


Hello.

 Please any one tell me a solution to this problem? can we do this
in struts? if not suggest me another alternative to build tree control!! i
am kind of stuck with this tree... it is killing me...

On Tue, Oct 7, 2008 at 12:12 PM, Jukka Välimaa <[EMAIL PROTECTED]>wrote:

> I don't know. One thing to try might be to run the expansion script after
> you're sure the tree widget has been rendered.
> Jukka
>
> On Wed, Oct 1, 2008 at 9:19 AM, Narayana S <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> >   Thanks for your reply, i tried this code but it is returning
> > nodes.length as zero though i have a tree with 1 root and 3 child nodes
> for
> > root. this is my code snippet
> > *tree
> >
> > * > childCollectionProperty="children" nodeIdProperty="fieldID"
> > nodeTitleProperty="fieldName" treeSelectedTopic="treeSelected"
> > expandedNotifyTopics="treeExpanded" />
> >
> > *javascript*
> >
> > 
> > var nodes =
> dojo.widget.manager.getWidgetsByType('struts:StrutsTreeNode');
> > alert("Number of nodes"+nodes.length);
> > for( var i=0; i < nodes.length; i++){
> >nodes[i].expand();
> >}
> > 
> >
> > what is the problem? am i missing anything? please help me to solve this
> > issue.
> >
> > On Tue, Sep 30, 2008 at 7:49 PM, Jukka Välimaa <[EMAIL PROTECTED]
> > >wrote:
> >
> > > As far as I know, it is not possible to expand tree widget server-side.
> > > Client-side, javascript can be used to open the tree, like so:var nodes
> =
> > > dojo.widget.manager.getWidgetsByType('struts:StrutsTreeNode');
> > > for( var i=0; i < nodes.length; i++){
> > > nodes[i].expand();
> > > }
> > >
> > > Jukka
> > >
> > > On Tue, Sep 30, 2008 at 4:59 PM, Narayana S <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > any one who worked on tree control plz give some helping hand
> > > >
> > > >
> > > >
> > > > On Fri, Sep 26, 2008 at 3:34 PM, Narayana S <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > Hi
> > > > >  Is it possible to display a tree expanded by default?
> > > > > I am using struts 2.1.2 dojo-plugin to create the tree structure.
> any
> > > one
> > > > > used tree...plz help me
> > > > >
> > > >
> > >
> >
>


RE: RegexFieldValidator

2008-10-07 Thread Gundersen, Richard
Sorry, ignore me. I needed to escape the slash as well, so my regex is 

[0-9]{1,5}\\.[0-9]{2}

Works now :)

Richard Gundersen
Java Developer
 
Email: [EMAIL PROTECTED]
Phone: 01618302398
Fax: 01618342536
London Scottish Bank plc
24 Mount Street
Manchester
M2 3LS

-Original Message-
From: Gundersen, Richard [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 07, 2008 11:09 AM
To: Struts Users Mailing List
Subject: RegexFieldValidator

Sorry, basic question but my RegexFieldValidator isn't working quite as
I thought it would. 

I just want to be able to specify a decimal point, so I escape the dot,
but the compiler complains. Could someone tell me how to specify
12345.67 as a regex for this?

^[0-9]{1,5}\.[0-9]{2}$  (doesn't compile in Eclipse)
\b[0-9]{1,5}\.[0-9]{2}\b(doesn't compile in Eclipse)
[0-9]{1,5}.[0-9]{2} (compiles, but is not correct)

I'm using it like this btw:
@RegexFieldValidator(key="validate.amount", fieldName="amount",
message="", expression="[0-9]{1,5}\.[0-9]{2}")

Thanks (sorry, I have googled etc, but I am also lame at regex...!)

Richard Gundersen
Java Developer
 
Email: [EMAIL PROTECTED]
Phone: 01618302398
Fax: 01618342536
London Scottish Bank plc
24 Mount Street
Manchester
M2 3LS

-Original Message-
From: Mead Lai [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 07, 2008 7:50 AM
To: Struts Users Mailing List
Subject: Re: how to pass parameter in next action

It's same like the parameter from jsp page.

AddComboValue?parm1=${value}
in your Action declare a

public String parm1;
getParm1()
setParm1()

now just use parm1 the get the value.
good luck.

On Tue, Oct 7, 2008 at 2:38 PM, Hardik Shah <[EMAIL PROTECTED]>
wrote:

>
> Thanks for reply
>
> and how i can get this parameter in my addattribute action java file
>
> using actioncontext or what?
>
>
>
>
> Mead Lai wrote:
> >
> >   > class="com.docmgmt.struts.actions.attribute.SaveAttribute">
> >attriblist
> > > type="redirect-action">AddComboValue?parm1=${value}
> >
> >
> > append the actionName "AddComboValue?parm1=${value}", but no
".action".
> > It's OK!
> >
> >
> > On Tue, Oct 7, 2008 at 1:22 PM, Hardik Shah <[EMAIL PROTECTED]>
> wrote:
> >
> >>
> >> can anybody say how to pass or push parameter in valuestack and get
it
> >> from
> >> another action in struts 2
> >>
> >> really confused with all valuestack stuff
> >>
> >> suppose
> >>
> >> i have
> >>
> >> 
> >>  >> class="com.docmgmt.struts.actions.attribute.SaveAttribute"
> >> method="AddComboValue">
> >>/attribute/AttribComboValue.jsp
> >>
> >>
> >>
> >> >> class="com.docmgmt.struts.actions.attribute.SaveAttribute">
> >>attriblist
> >> >> type="redirect-action">AddComboValue
> >>
> >>
> >> ---
> >>
> >> i want to put my one parameter attrid  in request scope when
executing
> >> AddAttribute action if result type ComboForm and want to get from
> >> AddComboValue action java file in struts 2.0.11.2
> >>
> >> can anybody gives me a way?
> >> thanks in advance
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
>
http://www.nabble.com/how-to-pass-parameter-in-next-action-tp19851255p19
851255.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >>
-
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > BestRegards,
> > Mead
> > http://yayisoft.com
> >
> > Dick Cavett  - "If your parents never had children, chances are you
won't
> > either."
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/how-to-pass-parameter-in-next-action-tp19851255p19
851925.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
BestRegards,
Mead
http://yayisoft.com

Everett Dirksen  - "A billion here and a billion there, and soon you're
talking about real money."


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

As a responsible corporate citizen, London Scottish Bank plc asks you to
consider the environment before printing this email.

*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use
of the addressee. It may contain private and confidential information.
The information, attachments and opinions contained in this E-mail are
those of its author only and do not necessarily represent those of

Re: Tree default expanded ??

2008-10-07 Thread Narayana S
Hello.

 Please any one tell me a solution to this problem? can we do this
in struts? if not suggest me another alternative to build tree control!! i
am kind of stuck with this tree... it is killing me...

On Tue, Oct 7, 2008 at 12:12 PM, Jukka Välimaa <[EMAIL PROTECTED]>wrote:

> I don't know. One thing to try might be to run the expansion script after
> you're sure the tree widget has been rendered.
> Jukka
>
> On Wed, Oct 1, 2008 at 9:19 AM, Narayana S <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> >   Thanks for your reply, i tried this code but it is returning
> > nodes.length as zero though i have a tree with 1 root and 3 child nodes
> for
> > root. this is my code snippet
> > *tree
> >
> > * > childCollectionProperty="children" nodeIdProperty="fieldID"
> > nodeTitleProperty="fieldName" treeSelectedTopic="treeSelected"
> > expandedNotifyTopics="treeExpanded" />
> >
> > *javascript*
> >
> > 
> > var nodes =
> dojo.widget.manager.getWidgetsByType('struts:StrutsTreeNode');
> > alert("Number of nodes"+nodes.length);
> > for( var i=0; i < nodes.length; i++){
> >nodes[i].expand();
> >}
> > 
> >
> > what is the problem? am i missing anything? please help me to solve this
> > issue.
> >
> > On Tue, Sep 30, 2008 at 7:49 PM, Jukka Välimaa <[EMAIL PROTECTED]
> > >wrote:
> >
> > > As far as I know, it is not possible to expand tree widget server-side.
> > > Client-side, javascript can be used to open the tree, like so:var nodes
> =
> > > dojo.widget.manager.getWidgetsByType('struts:StrutsTreeNode');
> > > for( var i=0; i < nodes.length; i++){
> > > nodes[i].expand();
> > > }
> > >
> > > Jukka
> > >
> > > On Tue, Sep 30, 2008 at 4:59 PM, Narayana S <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > any one who worked on tree control plz give some helping hand
> > > >
> > > >
> > > >
> > > > On Fri, Sep 26, 2008 at 3:34 PM, Narayana S <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > Hi
> > > > >  Is it possible to display a tree expanded by default?
> > > > > I am using struts 2.1.2 dojo-plugin to create the tree structure.
> any
> > > one
> > > > > used tree...plz help me
> > > > >
> > > >
> > >
> >
>


RegexFieldValidator

2008-10-07 Thread Gundersen, Richard
Sorry, basic question but my RegexFieldValidator isn't working quite as
I thought it would. 

I just want to be able to specify a decimal point, so I escape the dot,
but the compiler complains. Could someone tell me how to specify
12345.67 as a regex for this?

^[0-9]{1,5}\.[0-9]{2}$  (doesn't compile in Eclipse)
\b[0-9]{1,5}\.[0-9]{2}\b(doesn't compile in Eclipse)
[0-9]{1,5}.[0-9]{2} (compiles, but is not correct)

I'm using it like this btw:
@RegexFieldValidator(key="validate.amount", fieldName="amount",
message="", expression="[0-9]{1,5}\.[0-9]{2}")

Thanks (sorry, I have googled etc, but I am also lame at regex...!)

Richard Gundersen
Java Developer
 
Email: [EMAIL PROTECTED]
Phone: 01618302398
Fax: 01618342536
London Scottish Bank plc
24 Mount Street
Manchester
M2 3LS

-Original Message-
From: Mead Lai [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 07, 2008 7:50 AM
To: Struts Users Mailing List
Subject: Re: how to pass parameter in next action

It's same like the parameter from jsp page.

AddComboValue?parm1=${value}
in your Action declare a

public String parm1;
getParm1()
setParm1()

now just use parm1 the get the value.
good luck.

On Tue, Oct 7, 2008 at 2:38 PM, Hardik Shah <[EMAIL PROTECTED]>
wrote:

>
> Thanks for reply
>
> and how i can get this parameter in my addattribute action java file
>
> using actioncontext or what?
>
>
>
>
> Mead Lai wrote:
> >
> >   > class="com.docmgmt.struts.actions.attribute.SaveAttribute">
> >attriblist
> > > type="redirect-action">AddComboValue?parm1=${value}
> >
> >
> > append the actionName "AddComboValue?parm1=${value}", but no
".action".
> > It's OK!
> >
> >
> > On Tue, Oct 7, 2008 at 1:22 PM, Hardik Shah <[EMAIL PROTECTED]>
> wrote:
> >
> >>
> >> can anybody say how to pass or push parameter in valuestack and get
it
> >> from
> >> another action in struts 2
> >>
> >> really confused with all valuestack stuff
> >>
> >> suppose
> >>
> >> i have
> >>
> >> 
> >>  >> class="com.docmgmt.struts.actions.attribute.SaveAttribute"
> >> method="AddComboValue">
> >>/attribute/AttribComboValue.jsp
> >>
> >>
> >>
> >> >> class="com.docmgmt.struts.actions.attribute.SaveAttribute">
> >>attriblist
> >> >> type="redirect-action">AddComboValue
> >>
> >>
> >> ---
> >>
> >> i want to put my one parameter attrid  in request scope when
executing
> >> AddAttribute action if result type ComboForm and want to get from
> >> AddComboValue action java file in struts 2.0.11.2
> >>
> >> can anybody gives me a way?
> >> thanks in advance
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
>
http://www.nabble.com/how-to-pass-parameter-in-next-action-tp19851255p19
851255.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >>
-
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > --
> > BestRegards,
> > Mead
> > http://yayisoft.com
> >
> > Dick Cavett  - "If your parents never had children, chances are you
won't
> > either."
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/how-to-pass-parameter-in-next-action-tp19851255p19
851925.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
BestRegards,
Mead
http://yayisoft.com

Everett Dirksen  - "A billion here and a billion there, and soon you're
talking about real money."


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

As a responsible corporate citizen, London Scottish Bank plc asks you to 
consider the environment before printing this email.

*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use of the 
addressee. It may contain private and confidential information. The 
information, attachments and opinions contained in this E-mail are those of its 
author only and do not necessarily represent those of London Scottish Bank PLC 
or any other members of the London Scottish Group. 

If you are not the intended addressee, you are prohibited from any disclosure, 
distribution or further copying or use of this communication or the information 
in it or taking any action in reliance on it. If you have received this 
communication in error please notify the Information Security Manager at [EMAIL 
PROTECTED] as soon as possible and delete the m

S2 AJAX validation article

2008-10-07 Thread Oleg Mikheev
Hi all,

I've written an article on Struts 2 validation.
http://www.javaworld.com/javaworld/jw-10-2008/jw-10-struts2validation.html
Any comments are welcome, especially on the 'hack' proposed
there in 'advanced' section.
W/o that hack S2 AJAX validation would require me to
create a separate freemarker template per each web form.

Thanks,
Oleg


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



Re: SV: Ognl versions

2008-10-07 Thread Chris Pratt
Just as an experiment, you might try renaming the method as a true JavaBean
method.  Maybe OGNL got more strict on it's interpretation of the spec.
  (*Chris*)

On Mon, Oct 6, 2008 at 11:21 PM, <[EMAIL PROTECTED]> wrote:

> Hi,
> I mean that the value is null now that I use ognl 2.7.2. When using 2.6.11
> the value is a correct map.
>
> This is in the model för the jsp page:
>SortedMap jobTypeList = new TreeMap();
>
>public SortedMap getjobTypeList() {
>jobTypeList.put(1, "Förfrågan");
>jobTypeList.put(8, "VP-flytt");
>// return this.getWc().getTypeAsText();
>return jobTypeList;
>}
>
> /Gunnar
>
>
> > -Ursprungligt meddelande-
> > Från: Dale Newfield [mailto:[EMAIL PROTECTED]
> > Skickat: den 6 oktober 2008 20:34
> > Till: Bostrom Gunnar
> > Kopia: user@struts.apache.org
> > Ämne: Re: SV: Ognl versions
> >
> > [EMAIL PROTECTED] wrote:
> > > The jobTypelist is empty, but it worked with 2.6.11 version of ognl.
> > > The applications is our own.
> >
> > So you're saying that the updated version doesn't silently
> > fail, and that's enough to condemn it?  I would argue that
> > that's an improvement.
> >
> > In fact, if you look in the source code for the exception
> > stack you provide, this is by design:
> >
> > core/src/main/java/org/apache/struts2/components/ListUIBean.java:
> > > if (value == null) {
> > > if (throwExceptionOnNullValueAttribute) {
> > > // will throw an exception if not found
> > > value = findValue((list == null) ? (String)
> > list : list.toString(), "list",
> > > "The requested list key '" + list + "'
> > could not be resolved as a
> > collection/array/map/enumeration/iterator type. " +
> > > "Example: people or people.{name}");
> > > }
> > > else {
> > > // ww-1010, allows value with null value to
> > be compatible with ww
> > > // 2.1.7 behaviour
> > > value = findValue((list == null)?(String)
> > list:list.toString());
> > > }
> >  > }
> >
> > So, in fact, what you're finding through your testing is a
> > place where ognl 2.6.11 is doing the wrong thing.
> >
> > If you want silent failure, there's a flag to throw so that
> > your app gets it.  If you want to evaluate the correctness of
> > a component, please ensure you're testing what you think
> > you're testing.
> >
> > -Dale
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>