Convention plugin can't find Actions

2011-08-28 Thread chengas123
Hi,

I created the action below in a package ending with action and extended
ActionSupport.  Yet, the convention plugin is not finding the action.  I
installed the config browser plugin and it does not see the action.  Any
tips on how I can debug this?  I'm running this in embedded Jetty.  Does
that have anything to do with it?

Thanks,
Ben


package com.benmccann.webtemplate.frontend.action;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author Ben McCann (benmccann.com)
 */
public class Test extends ActionSupport {
  
  private static final long serialVersionUID = 1L;

  public String execute() throws Exception {
System.out.println(EXECUTE);
return SUCCESS;
  }

}


--
View this message in context: 
http://struts.1045723.n5.nabble.com/Convention-plugin-can-t-find-Actions-tp4744110p4744110.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Convention plugin can't find Actions

2011-08-28 Thread chengas123
Thanks for the suggestion.  Didn't help though.  Shouldn't the fact that it
extends ActionSupport be enough anyway?

--
View this message in context: 
http://struts.1045723.n5.nabble.com/Convention-plugin-can-t-find-Actions-tp4744110p4744116.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Convention plugin can't find Actions

2011-08-28 Thread chengas123
Got it working.  I needed to set the constants below in my struts.xml.  Could
be good to add this to the docs for other people using Jetty in embedded
mode.
  constant name=struts.convention.action.fileProtocols
value=jar,code-source /
  constant name=struts.convention.exclude.parentClassLoader value=false
/

-Ben


--
View this message in context: 
http://struts.1045723.n5.nabble.com/Convention-plugin-can-t-find-Actions-tp4744110p4744666.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Current version of Struts 2?

2009-08-06 Thread chengas123

Hi,
What's the current released version of Struts 2?  The homepage says it's
2.1.7, but when I go to download it, I can only download 2.1.6.  I've
noticed this problem many times in the past and it's always confused me.  If
2.1.7 is out, I really need a copy for the new struts.action.excludePattern

Thanks!
Ben

-- 
View this message in context: 
http://www.nabble.com/Current-version-of-Struts-2--tp24853877p24853877.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Struts 2 Tutorials

2008-09-20 Thread chengas123

Hi,
I wanted to give back to the community, so I wrote up some tutorials on
Struts 2.  They're available at: 
http://www.lumidant.com/blog/struts-2-tutorial-getting-started/
http://www.lumidant.com/blog/struts-2-tutorial-getting-started/   Hopefully,
they're helpful.  They might be good to list on the 
http://struts.apache.org/2.0.11.2/docs/other-resources.html Resources page 
in the documentation.

Thanks,
Ben

-- 
View this message in context: 
http://www.nabble.com/Struts-2-Tutorials-tp19590626p19590626.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] Escaping Characters in Struts Property Tag

2007-11-14 Thread chengas123

Ahh, yes, that was my problem.  I'm afraid I wasn't expecting that.  I don't
really see how allowing static method access presents a security problem.  I
am opening myself up to any obvious risks by turning this on?

Thanks,
Ben



DNewfield wrote:
 
 
 Have you turned off this capability (or rather not turned it back on)?
 struts.ognl.allowStaticMethodAccess
 https://issues.apache.org/struts/browse/WW-2160
 
 -Dale
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a13747747
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] Escaping Characters in Struts Property Tag

2007-11-14 Thread chengas123

I do see Dale's point now about the security risk.  
I'd generally agree with Dave that using a static method is basically the
same as a scriptlet.  However, in this case I can't say it really belongs in
my bean.  It's really more of a formatting issue.  I'd hate to have my bean
have two getters for every variable: one to get it regularly and one to get
the escaped version.  
Perhaps the property tag needs another attribute which would allow special
JavaScript characters to be escaped?

-Ben



newton.dave wrote:
 
 Another issue, a more stylistic one, is that using
 methods like this is barely better than scriptlets.
 Some would argue that this type of work belongs on the
 server side, especially if you're working with
 non-programming designers (although some can be
 trained to use a set of well-defined static methods
 once they have the syntax).
 
 d.
 
 --- Dale Newfield [EMAIL PROTECTED] wrote:
 
 chengas123 wrote:
 Ahh, yes, that was my problem.  I'm afraid I
 wasn't expecting that.  I don't
 really see how allowing static method access
 presents a security problem.  Am
 I opening myself up to any obvious risks by
 turning this on?
 
 If someone submits a value in a form that you mirror
 back to them in a 
 place that might be evaluated by ognl, then
 @[EMAIL PROTECTED](-1) would be 
 a pretty evil risk, no?  I'm pretty certain that the
 most recent xwork 
 .jar prevents ognl evaluation while setting
 parameters from the request, 
 so the path that string must take to be destructive
 is now much more 
 convoluted.
 
 -Dale
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a13752981
Sent from the Struts - User mailing list archive at Nabble.com.


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



Escaping Characters in Struts Property Tag

2007-11-13 Thread chengas123

Hi,
I want to use the struts property tag to set a JavaScript variable. 
Ordinarily, it would look something like:
var testValue = 's:property value=testValue /';

However, this does not work if the value has a single quote in it, so that
character needs to be escaped.  It should be easy, but I can't figure out
how to do it.  I can't return testValue.replaceAll(', \') as I'd like to
because the quotes in the call to replaceAll would interfere with the quotes
in property tag.  My only other idea was to create a class with a static
method, but I can't figure out how to call it.  Would it be something like:
var testValue = 's:property
value=@[EMAIL PROTECTED](comments) /'

Thanks,
Ben
-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a1373
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] Escaping Characters in Struts Property Tag

2007-11-13 Thread chengas123

That does not escape the single quote.

-Ben



DNewfield wrote:
 
 chengas123 wrote:
 var testValue = 's:property value=testValue /';
 
 However, this does not work if the value has a single quote in it
 
 Try:
 var testValue = s:property value='%{testValue}'/;
 
 -Dale
 
 

-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a13732806
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] Escaping Characters in Struts Property Tag

2007-11-13 Thread chengas123

Escape is true by default.  It escapes HTML characters such as  and  and
not single quotes.  

-Ben



Wes Wannemacher wrote:
 
 what about 's:property value=testValue escape=true /'
 
 -Wes
 
 

-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a13733962
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] Escaping Characters in Struts Property Tag

2007-11-13 Thread chengas123

Ahh, I'm afraid I'd missed that you reversed the order of the quotation
marks.  I was not aware that could be done.  However, what I'm actually
doing is putting the value into an onclick attribute.  I'm not sure I can
use this trick because then I end up with something like
onClick=myFunction('test  value ').  So I think escaping would still be
best for me, so I get what I actually want:  onClick=myFunction('test \'
value ');

-Ben



DNewfield wrote:
 
 
 Try:
 var testValue = s:property value='%{testValue}'/; 
 
 

-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a13734649
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] Escaping Characters in Struts Property Tag

2007-11-13 Thread chengas123

Thanks.  I will be sure to look at that.  
That brings me back to my original question though which is how do I call
that from within the property tag?

-Ben



DNewfield wrote:
 
 chengas123 wrote:
 I think escaping would still be best for me
 
 Then you're looking for:
 
 org.apache.commons.lang.StringEscapeUtils.escapeJavaScript()
 
 -Dale
 
 

-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a13735618
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] Escaping Characters in Struts Property Tag

2007-11-13 Thread chengas123

That is basically what I had been trying all along.  Am I doing anything
wrong?
s:property value=comments / returns what I am expecting.
s:property value=%{comments} / returns what I am expecting.
s:property
value=@[EMAIL PROTECTED](comments)
/ returns nothing.
s:property
value=[EMAIL PROTECTED]@escapeJavaScript(comments)}
/ returns nothing.

Thanks,
Ben



newton.dave wrote:
 
 --- chengas123 [EMAIL PROTECTED] wrote:
 That brings me back to my original question though
 which is how do I call that from within the property
 tag?
 
 http://struts.apache.org/2.x/docs/ognl-basics.html
 
 See the section called Accessing static properties.
 
 Nutshell:
 
 s:property
 value=@[EMAIL PROTECTED](valWithQuotes)/
 
 d.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a13737312
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] Escaping Characters in Struts Property Tag

2007-11-13 Thread chengas123

Yes.  That's definitely not the problem.  It's on my classpath, etc.  I was
originally trying this same thing with a custom String util class that I
wrote and that did not work either.  I should mention that I am using Struts
2.1.1.  If I am doing this correctly, then perhaps it's a bug? 

-Ben



DNewfield wrote:
 
 chengas123 wrote:
 s:property value=%{comments} / returns what I am expecting.
 s:property
 value=[EMAIL PROTECTED]@escapeJavaScript(comments)}
 / returns nothing.
 
 Do you have a commons-lang jar in your WEB-INF/lib?
 
 

-- 
View this message in context: 
http://www.nabble.com/Escaping-Characters-in-Struts-Property-Tag-tf4799846.html#a13737895
Sent from the Struts - User mailing list archive at Nabble.com.


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



Validation of Ajax Tags

2007-10-23 Thread chengas123

Does anyone have any ideas on how the dojo ajax tags can be validated
(autocompleter, datetimepicker, etc.)?  I was told this was fixed in 2.1,
which I am using, but I cannot get it to work.  I'd like to make my
autocompleter required and have it validate the same as my other fields. 
Can I validate its key?  What I'd really like to do is have the following
autocompleter:
sx:autocompleter label=Site value=%{system.site.name}
forceValidOption=true
cssStyle=width:132px; height:18px; border:1px solid #7B9EBD
name=site required=true href=%{siteList}
loadOnTextChange=true showDownArrow=false 
dropdownWidth=300
searchType=substring /

And then have this in my validation file:
  field name=siteKey
field-validator type=requiredstring
  messageField is required/message
/field-validator
  /field

-- 
View this message in context: 
http://www.nabble.com/Validation-of-Ajax-Tags-tf4680440.html#a13373975
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-08 Thread chengas123

Ahh!  That was my problem.
I think it would be worth mentioning this in the documentation, especially
since it is the reverse of 2.0.x.  It's not real clear in the state example
which is the key and which is the value.  I tried to edit the docs myself,
but the wiki told me I did not have permission.  

Thanks for your help,
Ben



Musachy Barroso wrote:
 
 
 One think to keep in  mind is, when you build the json, the key and
 the values are in the wrong order. So it would be:
 
 {
Alabama : AL
 }
 
 instead of :
 
 {
Al : Alabama
 }
 
 
 I know it is confusing, but we inherited that from Dojo and changing
 it would break backward compatibility.
 
 regards
 musachy
 
 
  chengas123 wrote:
  
   Converting the tags to use the new library wasn't very hard except
 that I
   can't seem to get the new tags to work.  I turned the debugging on in
 the
   head tag and the only debug message I got was DEBUG: please consider
   using a mimetype of text/json-comment-filtered to avoid potential
 security
   issues with JSON endpoints.  I've placed the relevant code from my
 .jsp
   below.  Is there anything I forgot when converting to 2.1 besides the
   steps Nicholas mentioned?  I do see my action being called when I
 type in
   the autocompleter box.  If I manually visit the URL I am given the
   following JSON: {1:Internet Services}
  
   %@ taglib prefix=sx uri=/struts-dojo-tags %
   sx:head cache=true debug=true /
   sx:autocompleter label=Department forceValidOption=true
   cssStyle=width:132px; height:18px; border:1px solid #7B9EBD
   name=department required=true href=%{departmentList}
   loadOnTextChange=true showDownArrow=false
   searchType=substring /
  
  
   Thanks,
   Ben
  
  
 
  --
  View this message in context:
 http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13064915
  Sent from the Struts - User mailing list archive at Nabble.com.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13098417
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-08 Thread chengas123

There's not a link anywhere on the page to add a comment:
http://struts.apache.org/2.x/docs/autocompleter.html
Is there some other way I need to access that functionality?

Thanks,
Ben



Ted Husted wrote:
 
 
 But, if you open a Confluence account, you should still be able to add a
 comment.
 
 -Ted.
 
 On 10/8/07, chengas123 [EMAIL PROTECTED] wrote:

 Ahh!  That was my problem.
 I think it would be worth mentioning this in the documentation,
 especially
 since it is the reverse of 2.0.x.  It's not real clear in the state
 example
 which is the key and which is the value.  I tried to edit the docs
 myself,
 but the wiki told me I did not have permission.

 Thanks for your help,
 Ben

 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13103506
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-08 Thread chengas123

Ahh.  I'm afraid I never would have figured that out without explanation
since I get permission denied when hitting the edit link.  

-Ben



Ted Husted wrote:
 
 It's a bit kludgy. If you select edit page, and you are not logged
 in, it will prompt for your credentials. Once past that, you should
 end up on the wiki side, for example at
 
  * http://cwiki.apache.org/confluence/display/WW/Home
 
 At this point, there should be a Add Comment link at the bottom of the
 page.
 
 The autoexport template is not showing the comments on the autoexport
 page, but maybe we can push to get the comments rolled into the main
 text for 2.1.0. There doesn't seem to be a report, but the daily
 updates mention when comments are added.
 
 -Ted.
 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13104703
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-08 Thread chengas123

The speed issues are much better in 2.1.  However, now when I load the page,
every autocompleter on that page is issuing a request.  Is this a bug or
have I configured something incorrectly?  I believe the default behavior for
this should be to issue a request only after three characters have been
typed.
Here's an example of how I am including an autocompleter on my page:
td style=width:150px
s:text name=form.label.lastName/br /
s:url id=lastNameList action=AutocompleteField
method=getLastNames /
sx:autocompleter name=lastName id=lastName
cssStyle=width:132px; height:16px; border:1px solid #7B9EBD
href=%{lastNameList} size=22 dropdownWidth=200 dropdownHeight=150
showDownArrow=false autoComplete=false loadOnTextChange=true
searchType=startstring /  
/td

Thanks,
Ben



Musachy Barroso wrote:
 
 Setting cache=true will pretty much kill the Dojo lazy loading
 feature, as it will use a custom build (all the required js files
 compressed in one file). On top of that 2.1 won't scan the whole page
 for widgets, which will make it even faster.
 
 musachy
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13105568
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-05 Thread chengas123

Converting the tags to use the new library wasn't very hard except that I
can't seem to get the new tags to work.  I turned the debugging on in the
head tag and the only debug message I got was DEBUG: please consider using
a mimetype of text/json-comment-filtered to avoid potential security issues
with JSON endpoints.  I've placed the relevant code from my .jsp below.  Is
there anything I forgot when converting to 2.1 besides the steps Nicholas
mentioned?  I do see my action being called when I type in the autocompleter
box.  If I manually visit the URL I am given the following JSON:
{1:Internet Services}

%@ taglib prefix=sx uri=/struts-dojo-tags %
sx:head cache=true debug=true /
sx:autocompleter label=Department forceValidOption=true
cssStyle=width:132px; height:18px; border:1px solid #7B9EBD
name=department required=true href=%{departmentList}
loadOnTextChange=true showDownArrow=false
searchType=substring /


Thanks,
Ben



Engelking, Nicholas wrote:
 
 One thing to keep in mind is that you will have to migrate from the old
 struts tags with theme=ajax to the new ajax specific struts tags. I
 found that the new tags were basically the same as the old ones, but I did
 have to go through, drop the theme, and change the tag library. It's
 probably something that you can automate with regular expression though.
 
 On a side note, I am in the process of migrating out of dojo for
 performance reasons. Even with the new caching feature, turning
 parseContent off, and using the tomcat native library, widget loading in
 the browser (especially i.e. 6, which is our target platform) is slow.
 Server response times are quick, but it just takes the dojo framework a
 long time to register a high number of widgets per page (in one case over
 600 in our site). I think the sight could benefit from some paging to cut
 down on browser load and fight information overload for the user, but I am
 not in control of the interface spec and it is not possible to have it
 changed. I am still looking for something faster or perhaps we will have
 to go back to (heaven forbid) framesets. Or maybe I will get really lucky
 and UI will realize that they need to change their spec.
 
 -Nick
 
 
Yes, it is working for me now.  I checked out the project and did not have
to
change any of the pom.xml files.  I will let you know how my performance
tests go with the new plug in.

Thanks,
Ben
 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13060575
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-05 Thread chengas123

Turns out the problem is that the autocompleter is broken for maps.  Using
the map example given in the documentation
(http://struts.apache.org/2.x/docs/autocompleter.html) does not work:
sx:autocompleter name=test label=test list={'Alabama':'AL',
'Alaska':'AK'} autoComplete=false/
However, it works when a list is given:
sx:autocompleter name=test label=test list={'AL', 'AK'}
autoComplete=false/

-Ben



chengas123 wrote:
 
 Converting the tags to use the new library wasn't very hard except that I
 can't seem to get the new tags to work.  I turned the debugging on in the
 head tag and the only debug message I got was DEBUG: please consider
 using a mimetype of text/json-comment-filtered to avoid potential security
 issues with JSON endpoints.  I've placed the relevant code from my .jsp
 below.  Is there anything I forgot when converting to 2.1 besides the
 steps Nicholas mentioned?  I do see my action being called when I type in
 the autocompleter box.  If I manually visit the URL I am given the
 following JSON: {1:Internet Services}
 
 %@ taglib prefix=sx uri=/struts-dojo-tags %
 sx:head cache=true debug=true /
 sx:autocompleter label=Department forceValidOption=true
 cssStyle=width:132px; height:18px; border:1px solid #7B9EBD
 name=department required=true href=%{departmentList}
 loadOnTextChange=true showDownArrow=false
 searchType=substring /
 
 
 Thanks,
 Ben
 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13064915
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-05 Thread chengas123

Adding the pound sign did work for me in the hardcoded example
sx:autocompleter name=test label=test list=#{'Alabama':'AL',
'Alaska':'AK'} autoComplete=false/

Will my action need to add a pound sign as well or is that only because I
was using list instead of href?  Right now my action is returning
{1:Internet Services}, which works in 2.0.9.  This is what is returned
by the json plugin.



Wes Wannemacher wrote:
 
 OGNL's anonymous map creation uses the '#' character 
 
 Looking at what you were trying makes me think that you were confused
 by the JSON string. It appears that there isn't mention of using a Map
 for the list= attrib, but I assume that it acts the same as it did in
 2.0.x
 
 -W
 
 
 chengas123 wrote:
 
  Converting the tags to use the new library wasn't very hard except that
 I
  can't seem to get the new tags to work.  I turned the debugging on in
 the
  head tag and the only debug message I got was DEBUG: please consider
  using a mimetype of text/json-comment-filtered to avoid potential
 security
  issues with JSON endpoints.  I've placed the relevant code from my
 .jsp
  below.  Is there anything I forgot when converting to 2.1 besides the
  steps Nicholas mentioned?  I do see my action being called when I type
 in
  the autocompleter box.  If I manually visit the URL I am given the
  following JSON: {1:Internet Services}
 
  %@ taglib prefix=sx uri=/struts-dojo-tags %
  sx:head cache=true debug=true /
  sx:autocompleter label=Department forceValidOption=true
  cssStyle=width:132px; height:18px; border:1px solid #7B9EBD
  name=department required=true href=%{departmentList}
  loadOnTextChange=true showDownArrow=false
  searchType=substring /
 
 
  Thanks,
  Ben
 
 

 --
 View this message in context:
 http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13064915
 Sent from the Struts - User mailing list archive at Nabble.com.
 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13065892
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-04 Thread chengas123

Thank you for the suggestion, but unfortunately I still can't figure out how
to get it to build as this is my first experience with Maven.
I noticed someone placed struts-2.1.0-SNAPSHOT-lib.zip in the nightlies
directory which I appreciate greatly, but while it includes most of the
plugins, the dojo plugin is not there.  Would anyone who's familiar with the
nightly build process mind taking a look to see if the dojo build could be
included?

Thanks,
Ben



newton.dave wrote:
 
 I don't know enough about Maven to be able to help you
 much, but it may be as simple as clearing your repo
 cache (or whatever it's called). I am building from
 trunk with the below change w/o any difficulty, at
 least as of about a week ago.
 
 --- chengas123 [EMAIL PROTECTED] wrote:
 
 
 If this is a known issue, why doesn't someone commit
 the change?  I
 understand this is the development branch, but it's
 a pretty critical issue
 to not be able to build the project.  Among other
 things, it has to be a
 deterrent in attracting new developers.
 If I make that change I get:
 [WARNING] Unable to load parent project from
 repository: Could not find
 the model file 'C:\struts2\..\pom.xml'. for project
 unknown
 And then later on it actually tries to compile, but
 gets dozens of
 compilation errors.  The first of which is: 


 C:\struts2\core\src\main\java\org\apache\struts2\components\Debug.java:[25,46]
 package com.opensymphony.xwork2.util.reflection does
 not exist
 
 
 
 newton.dave wrote:
  
  IIRC there is still an issue with trunk regarding
 the
  opensymphony id; it's something like
  xwork.opensymphony.com and needs to be just
  opensymphony... um...
  
  Index: core/pom.xml
 

 ===
  --- core/pom.xml(revision 580129)
  +++ core/pom.xml(working copy)
  @@ -55,7 +55,7 @@
   configuration
   artifactItems
   artifactItem
  -   
  groupIdcom.opensymphony.xwork/groupId
  +   
  groupIdopensymphony/groupId
  
  artifactIdxwork/artifactId
  
  version2.1-SNAPSHOT/version
  
  classifiersources/classifier
  @@ -289,7 +289,7 @@
  
   dependencies
   dependency
  -   
 groupIdcom.opensymphony.xwork/groupId
  +groupIdopensymphony/groupId
   artifactIdxwork/artifactId
   version2.1-SNAPSHOT/version
   /dependency
  
  --- chengas123 [EMAIL PROTECTED]
 wrote:
  
  
  Ok.  I tried downloading from SVN, but got a
 build
  error.  Maven could not
  find xwork-2.1-SNAPSHOT-sources.jar.  I had to
  download it manually from
  maven.opensymphony.com.  However, despite
 following
  the instruction maven
  was giving me I could not figure out how to build
  the project with the
  manual download.
  
  -Ben
  
  
 
 -- 
 View this message in context:

 http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13029359
 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/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13046693
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-04 Thread chengas123



Wes Wannemacher wrote:
 
 There is probably very little difference between the nightly build and
 trunk, I have found it's pretty easy to just build from trunk. If you
 don't have them already, get subversion and maven (both small
 downloads) and build it yourself.
 
 Follow the instructions from this thread -
 
 http://www.nabble.com/struts-2.1-beta-tf4509951.html#a12880737
 
 You'll have your own xwork and struts2 pretty quickly.
 
 -Wes
 
 


I was trying to build myself, but I'm afraid I can't agree that it's pretty
easy.  It appears the pom.xml files are broken along with who knows what
else.

-Ben




 
 --- chengas123 [EMAIL PROTECTED] wrote:
 

 If this is a known issue, why doesn't someone commit
 the change?  I
 understand this is the development branch, but it's
 a pretty critical issue
 to not be able to build the project.  Among other
 things, it has to be a
 deterrent in attracting new developers.
 If I make that change I get:
 [WARNING] Unable to load parent project from
 repository: Could not find
 the model file 'C:\struts2\..\pom.xml'. for project
 unknown
 And then later on it actually tries to compile, but
 gets dozens of
 compilation errors.  The first of which is:


 C:\struts2\core\src\main\java\org\apache\struts2\components\Debug.java:[25,46]
 package com.opensymphony.xwork2.util.reflection does
 not exist



 newton.dave wrote:
 
  IIRC there is still an issue with trunk regarding
 the
  opensymphony id; it's something like
  xwork.opensymphony.com and needs to be just
  opensymphony... um...
 
  Index: core/pom.xml
 

 ===
  --- core/pom.xml(revision 580129)
  +++ core/pom.xml(working copy)
  @@ -55,7 +55,7 @@
   configuration
   artifactItems
   artifactItem
  -  
  groupIdcom.opensymphony.xwork/groupId
  +  
  groupIdopensymphony/groupId
 
  artifactIdxwork/artifactId
 
  version2.1-SNAPSHOT/version
 
  classifiersources/classifier
  @@ -289,7 +289,7 @@
 
   dependencies
   dependency
  -  
 groupIdcom.opensymphony.xwork/groupId
  +groupIdopensymphony/groupId
   artifactIdxwork/artifactId
   version2.1-SNAPSHOT/version
   /dependency
 
  --- chengas123 [EMAIL PROTECTED]
 wrote:
 
 
  Ok.  I tried downloading from SVN, but got a
 build
  error.  Maven could not
  find xwork-2.1-SNAPSHOT-sources.jar.  I had to
  download it manually from
  maven.opensymphony.com.  However, despite
 following
  the instruction maven
  was giving me I could not figure out how to build
  the project with the
  manual download.
 
  -Ben
 
 

 --
 View this message in context:

 http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13029359
 Sent from the Struts - User mailing list archive at
 Nabble.com.
 
 
 


-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13047981
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-04 Thread chengas123

Yes, it is working for me now.  I checked out the project and did not have to
change any of the pom.xml files.  I will let you know how my performance
tests go with the new plug in.

Thanks,
Ben



Musachy Barroso wrote:
 
 The dependency seems to be fine (it was broken before). On core:
 
 dependency
  groupIdcom.opensymphony.xwork/groupId
   artifactIdxwork/artifactId
   version2.1-SNAPSHOT/version
  /dependency
 
 on xwork trunk:
 
 groupIdcom.opensymphony.xwork/groupId
 artifactIdxwork/artifactId
  version2.1-SNAPSHOT/version
 
 regards
 musachy
 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13049126
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-03 Thread chengas123

Thank you all for your responses.  I apologize that mine is so delayed.  I am
going to try using 2.1 with the cache attribute and see what the difference
is.  It sounds like it should be a major improvement.  I believe the problem
was that it was requesting so many files and it appeared the browser waited
until the previous had finished before requesting the next, so the latency
was through the roof.  Having only one or two files should be a huge
improvement.
I downloaded the  http://people.apache.org/builds/struts/nightlies/2.x/
nightlies .  Do I need struts2-api in addition to struts2-core?  Either way,
I am presented with only a blank white screen when I try to use the new
libraries in places of the 2.0.9 library.  Is there anything else I would
need to change to use 2.1?

Thanks,
Ben



Don Brown wrote:
 
 Oh, ok, so this is something that we can do once and every user
 doesn't have to do it manually for their application?  Then yes, let's
 make the cache flag true by default.  If the user wants to trim down
 the profile, they can, but at least they'll get way better performance
 out of the box.
 
 Don
 
 On 9/25/07, Musachy Barroso [EMAIL PROTECTED] wrote:
 The cache attribute is available on 2.1, and is documented on the head
 tag:

 http://struts.apache.org/2.x/docs/dojo-head.html

 We could definitely make it a default, which it isn't now.

 The issue to automate the custom profile build is here:

 https://issues.apache.org/struts/browse/WW-2131

 right now I build the custom profile and upload the files by hand.
 Help to get this done with maven would be appreciated.

 musachy
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13024548
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-03 Thread chengas123

I found some error messages buried in my log file.  It seems 2.1 is not
working for me because Dojo was moved to a plugin which I do not have.  Is
there anyway to get a compiled version of this plugin?  Or do I have to
download 2.1 from source control and compile it myself?

Thanks,
Ben



chengas123 wrote:
 
 Thank you all for your responses.  I apologize that mine is so delayed.  I
 am going to try using 2.1 with the cache attribute and see what the
 difference is.  It sounds like it should be a major improvement.  I
 believe the problem was that it was requesting so many files and it
 appeared the browser waited until the previous had finished before
 requesting the next, so the latency was through the roof.  Having only one
 or two files should be a huge improvement.
 I downloaded the  http://people.apache.org/builds/struts/nightlies/2.x/
 nightlies .  Do I need struts2-api in addition to struts2-core?  Either
 way, I am presented with only a blank white screen when I try to use the
 new libraries in places of the 2.0.9 library.  Is there anything else I
 would need to change to use 2.1?
 
 Thanks,
 Ben
 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13026612
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-03 Thread chengas123

Ok.  I tried downloading from SVN, but got a build error.  Maven could not
find xwork-2.1-SNAPSHOT-sources.jar.  I had to download it manually from
maven.opensymphony.com.  However, despite following the instruction maven
was giving me I could not figure out how to build the project with the
manual download.

-Ben



Musachy Barroso wrote:
 
 I don't think it is on the snapshots.
 
 musachy
 
 On 10/3/07, chengas123 [EMAIL PROTECTED] wrote:

 I found some error messages buried in my log file.  It seems 2.1 is not
 working for me because Dojo was moved to a plugin which I do not have. 
 Is
 there anyway to get a compiled version of this plugin?  Or do I have to
 download 2.1 from source control and compile it myself?

 Thanks,
 Ben

 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13028025
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: [s2] Struts head tag KILLS ( 10s) page load time

2007-10-03 Thread chengas123

If this is a known issue, why doesn't someone commit the change?  I
understand this is the development branch, but it's a pretty critical issue
to not be able to build the project.  Among other things, it has to be a
deterrent in attracting new developers.
If I make that change I get:
[WARNING] Unable to load parent project from repository: Could not find
the model file 'C:\struts2\..\pom.xml'. for project unknown
And then later on it actually tries to compile, but gets dozens of
compilation errors.  The first of which is: 
   
C:\struts2\core\src\main\java\org\apache\struts2\components\Debug.java:[25,46]
package com.opensymphony.xwork2.util.reflection does not exist



newton.dave wrote:
 
 IIRC there is still an issue with trunk regarding the
 opensymphony id; it's something like
 xwork.opensymphony.com and needs to be just
 opensymphony... um...
 
 Index: core/pom.xml
 ===
 --- core/pom.xml(revision 580129)
 +++ core/pom.xml(working copy)
 @@ -55,7 +55,7 @@
  configuration
  artifactItems
  artifactItem
 -   
 groupIdcom.opensymphony.xwork/groupId
 +   
 groupIdopensymphony/groupId
 
 artifactIdxwork/artifactId
 
 version2.1-SNAPSHOT/version
 
 classifiersources/classifier
 @@ -289,7 +289,7 @@
 
  dependencies
  dependency
 -groupIdcom.opensymphony.xwork/groupId
 +groupIdopensymphony/groupId
  artifactIdxwork/artifactId
  version2.1-SNAPSHOT/version
  /dependency
 
 --- chengas123 [EMAIL PROTECTED] wrote:
 
 
 Ok.  I tried downloading from SVN, but got a build
 error.  Maven could not
 find xwork-2.1-SNAPSHOT-sources.jar.  I had to
 download it manually from
 maven.opensymphony.com.  However, despite following
 the instruction maven
 was giving me I could not figure out how to build
 the project with the
 manual download.
 
 -Ben
 
 

-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a13029359
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] Struts head tag KILLS ( 10s) page load time

2007-09-20 Thread chengas123

Hi,
I am working on a Struts 2 page and page load times are way too high.  I
tracked it down to the Struts head tag, which I have as follows: s:head
theme=ajax /
Without the tag, my page issues 3 requests and takes 453ms to load.  With
the tag, the page issues 54 requests taking 12.24s to load.  
Is there something I am doing wrong here?

Thanks,
Ben
-- 
View this message in context: 
http://www.nabble.com/-s2--Struts-head-tag-KILLS-%28%3E-10s%29-page-load-time-tf4490390.html#a12806509
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: [S2] Accessing autocompleter value from JavaScript

2007-07-25 Thread chengas123


Ravi Kumar-26 wrote:
 
 On 7/25/07, chengas123 [EMAIL PROTECTED] wrote:
 I had an HTML input I was accessing in script as follows:
document.inputForm.city.value
 I replaced it with a Struts autocompleter and cannot access it in that
 manner anymore. 
 
 Hey ,
  I think it is not text filed it is select box. so try to access using
 input
 type as select
 Thanks
 Ravi
 


I don't understand.  I can access a select from JavaScript the same exact
way I would access a text box.  The real problem is that I can't figure out
if there is a named element on the page to access.  If I do
alert(document.inputForm.city) then I get a popup box that says undefined.  
So the problem isn't in the manner in which I'm accessing it, but that the
element does not even exist.  Do I need to change something in my Struts tag
to make the element accessible from script?

Thanks,
Ben


-- 
View this message in context: 
http://www.nabble.com/-S2--Accessing-autocompleter-value-from-JavaScript-tf4138749.html#a11781657
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: [S2] Accessing autocompleter value from JavaScript

2007-07-25 Thread chengas123

Awesome!  That worked like a charm :o)  Thanks so much!

-Ben




Musachy Barroso wrote:
 
 http://www.nabble.com/Extract-autocompleter-value-from-javascript%2C-when-autocompleter-is-in-a-%3Cs%3Adiv-object-tf3883593.html#a11007078
 
 On 7/25/07, chengas123 [EMAIL PROTECTED] wrote:


 Ravi Kumar-26 wrote:
 
  On 7/25/07, chengas123 [EMAIL PROTECTED] wrote:
  I had an HTML input I was accessing in script as follows:
 document.inputForm.city.value
  I replaced it with a Struts autocompleter and cannot access it in that
  manner anymore.
 
  Hey ,
   I think it is not text filed it is select box. so try to access using
  input
  type as select
  Thanks
  Ravi
 


 I don't understand.  I can access a select from JavaScript the same exact
 way I would access a text box.  The real problem is that I can't figure
 out
 if there is a named element on the page to access.  If I do
 alert(document.inputForm.city) then I get a popup box that says
 undefined.
 So the problem isn't in the manner in which I'm accessing it, but that
 the
 element does not even exist.  Do I need to change something in my Struts
 tag
 to make the element accessible from script?

 Thanks,
 Ben


 --
 View this message in context:
 http://www.nabble.com/-S2--Accessing-autocompleter-value-from-JavaScript-tf4138749.html#a11781657
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Accessing-autocompleter-value-from-JavaScript-tf4138749.html#a11784710
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: [S2] Autocompleter with JSON plugin

2007-07-24 Thread chengas123

More specifically I have:
s:head theme=ajax /


chengas123 wrote:
 
 Yep, I do.
 
 
 Roberto Nunnari wrote:
 
 Do you have the s:head tag? It won't work without that.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Autocompleter-with-JSON-plugin-tf4132448.html#a11764525
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: [S2] Autocompleter with JSON plugin

2007-07-24 Thread chengas123

I thought I would add that I put some debug code in my Action and I can see
it being called when I type in the box.  Yet there does not appear to be
anything happening on the client side.  Is my JSON not formatted properly? 
What's the problem here?

Thanks,
Ben



chengas123 wrote:
 
 Hi,
 I'm having trouble getting the autocompleter working.  When I type in the
 box, nothing happens.
 I am using Struts 2.0.8 with JSON plugin 0.15.
 
 The relevant lines from my JSP are:
 s:url id=jsonList value=/AutocompleteField.action/
 s:autocompleter name=city theme=ajax href=%{jsonList}
 dataFieldName=json cssStyle=width:132px showDownArrow=false
 autoComplete=true searchType=startstring /  
 
 If I visit AutocompleteField.action?city=cle I get the following:

 {json:[CLEARFIELD,CLEARWATER,CLEBURNE,CLEMMONS,CLERMONT,CLEVELAND]}
 
 Thanks,
 Ben
  http://www.benmccann.com benmccann.com 
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Autocompleter-with-JSON-plugin-tf4132448.html#a11766335
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: [S2] Autocompleter with JSON plugin

2007-07-24 Thread chengas123


newton.dave wrote:
 
 --- chengas123 [EMAIL PROTECTED] wrote:
 Is my JSON not formatted properly? 
 
 http://struts.apache.org/2.x/docs/ajax-tags.html#AjaxTags-autocompleterTag
 
 Has the Ajax tag been updated to use JSON from the
 JSON result type? If so, the docs should be changed,
 otherwise I could see that being an issue.
  
 d.
 

It would appear it works in 2.0.7 (which is why I upgraded to the latest:
2.0.8):
   
http://www.nabble.com/s.autocompleter-with-JSON-Plugin-tf3418364.html#a9529727

-- 
View this message in context: 
http://www.nabble.com/-S2--Autocompleter-with-JSON-plugin-tf4132448.html#a11767651
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: [S2] Autocompleter with JSON plugin

2007-07-24 Thread chengas123


Musachy Barroso wrote:
 
 It looks ok to me, not sure what is going on. Check:
 
 http://struts.apache.org/2.x/docs/ajax-and-javascript-recipes.html#AjaxandJavaScriptRecipes-Autocompleter
 
 for an example of working with both together.
 
 musachy
 

The example has a method called getOptions returning a Map.  However, I
don't see how getOptions is ever called.  
Also, the example is using Struts 2.1.0 which hasn't been released yet.  I
am only using 2.0.8.  The example has a tag include %@ taglib prefix=sx
uri=/struts-dojo-tags % which is not present in my project.
Also, does it matter that I am using a List instead of a Map?

I have the following in my struts.xml:
action name=AutocompleteField
class=com.sherwin.whitePages.action.AutocompleteField
result type=json /
/action

And the following in my AutocompleteField.java action:
private List json;
public String execute() throws Exception {
PersonDAO dao = new PersonDAO();
if(!isEmpty(city)) {
json = dao.getCities(city);
}
return SUCCESS;
}

-- 
View this message in context: 
http://www.nabble.com/-S2--Autocompleter-with-JSON-plugin-tf4132448.html#a11768451
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: [S2] Autocompleter with JSON plugin

2007-07-24 Thread chengas123


Musachy Barroso wrote:
 
 It looks ok to me, not sure what is going on. Check:
 
 http://struts.apache.org/2.x/docs/ajax-and-javascript-recipes.html#AjaxandJavaScriptRecipes-Autocompleter
 
 for an example of working with both together.
 
 musachy
 

OK!  I'm in action now!
Thanks for pointing me to that example.  I had to do two things to get it to
work (still using 2.0.8).  I changed my List to a Map (I just put everything
in there twice - as a key and a value) and I had to change my struts.xml as
shown below to specify the root parameter as json, which was the name of the
Map in my action:

action name=AutocompleteField
class=com.sherwin.whitePages.action.AutocompleteField
result type=json
json
/result
/action
-- 
View this message in context: 
http://www.nabble.com/-S2--Autocompleter-with-JSON-plugin-tf4132448.html#a11770551
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] Tabindex not working on autocompleter

2007-07-24 Thread chengas123

Hi,

I have a bunch of inputs with tabindex defined on each.  Some are regular
HTML inputs and some are struts autocompleters as shown below:  
s:autocompleter name=city theme=ajax href=%{jsonList} size=22
tabindex=5 dropdownWidth=200 showDownArrow=false autoComplete=true
loadOnTextChange=true searchType=startstring /  

The Struts tabindex is not working (I have tested in both Firexfox and IE). 
Is this something I should report as a bug or am I doing something wrong?

Thanks,
Ben

-- 
View this message in context: 
http://www.nabble.com/-S2--Tabindex-not-working-on-autocompleter-tf4138603.html#a11771754
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] Accessing autocompleter value from JavaScript

2007-07-24 Thread chengas123

Hi,

I had an HTML input I was accessing in script as follows:
document.inputForm.city.value

I replaced it with a Struts autocompleter and cannot access it in that
manner anymore.  Can anyone tell me how I can access it?

Thanks,
Ben
http://www.benmccann.com benmccann.com 
-- 
View this message in context: 
http://www.nabble.com/-S2--Accessing-autocompleter-value-from-JavaScript-tf4138749.html#a11772185
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] Autocompleter with JSON plugin

2007-07-23 Thread chengas123

Hi,
I'm having trouble getting the autocompleter working.  When I type in the
box, nothing happens.
I am using Struts 2.0.8 with JSON plugin 0.15.

The relevant lines from my JSP are:
s:url id=jsonList value=/AutocompleteField.action/
s:autocompleter name=city theme=ajax href=%{jsonList}
dataFieldName=json cssStyle=width:132px showDownArrow=false
autoComplete=true searchType=startstring /  

If I visit AutocompleteField.action?city=cle I get the following:
   
{json:[CLEARFIELD,CLEARWATER,CLEBURNE,CLEMMONS,CLERMONT,CLEVELAND]}

Thanks,
Ben
http://www.benmccann.com benmccann.com 
-- 
View this message in context: 
http://www.nabble.com/-S2--Autocompleter-with-JSON-plugin-tf4132448.html#a11752774
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: [S2] Autocompleter with JSON plugin

2007-07-23 Thread chengas123

Yep, I do.


Roberto Nunnari wrote:
 
 Do you have the s:head tag? It won't work without that.
 

-- 
View this message in context: 
http://www.nabble.com/-S2--Autocompleter-with-JSON-plugin-tf4132448.html#a11754924
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: [S2] Accessing HTTP Header

2007-06-13 Thread chengas123

Thank you both for your responses.  While I had tried going down the
ActionInvocation.getInvocationContext(...) road I didn't see anything
interesting that way and probably would have never thought to cast it to a
ServletActionContext (although hopefully I will next time).  I'm using the
ThreadLocal approach right now for brevity.  Is there any performance
difference or other difference between the two approaches that I should be
aware of?  



Yoni Amir-2 wrote:
 
 Here is an interceptor that I use to manipulate the HttpResponse
 object. You can do the same for the HttpRequest.
 
 public String intercept(ActionInvocation actionInvocation) throws
 Exception {
   HttpServletResponse resp = ServletActionContext.getResponse();
   resp.setHeader(Pragma, no-cache);
   // etc ...
 }
 
 Notice that ActionContext (and ServletActionContext) is ThreadLocal.
 That's why this code is so concise.
 
 
 On 6/13/07, Dave Newton [EMAIL PROTECTED] wrote:
 Follow the yellow brick API...

 What's the signature of Interceptor.intercept?

 String intercept(ActionInvocation)

 What's an ActionInvocation? Oh, it's an interface. One
 thing that looks particularly interesting is
 ActionInvocation.getInvocationContext(...) -- it's
 interesting because it contains the word context.

 Okay, that returns an ActionContext. One
 *particularly* interesting implementation of
 ActionContext is ServletActionContext.

 d.

 

-- 
View this message in context: 
http://www.nabble.com/-S2--Accessing-HTTP-Header-tf3907721.html#a11100917
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] Accessing HTTP Header

2007-06-12 Thread chengas123

Hi,
How do I access the request variable or HTTP request headers?  I want to do
something like the following in my action:
request.getHeader(Accept).toLowerCase().indexOf(vnd.wap)
I am trying to detect whether the user is using a wireless device such as a
Blackberry in my action to determine which .jsp to send the user to in order
to display the output in a nicely formatted manner.

Thanks,
Ben
http://benmccann.com benmccann.com 

-- 
View this message in context: 
http://www.nabble.com/-S2--Accessing-HTTP-Header-tf3907721.html#a11079394
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: [S2] Accessing HTTP Header

2007-06-12 Thread chengas123


nuwan chandrasoma-2 wrote:
 
 http://struts.apache.org/2.x/docs/how-can-we-access-the-httpservletrequest.html
 

Struts Documentation wrote:
 
 It is more difficult to test Actions with runtime dependencies on
 HttpServletRequest. Only implement ServletRequestAware as a last resort.
 If the use case cannot be solved by one of the other servet-config
 interfaces (ApplicationAware, SessionAware, ParameterAware), consider
 whether an custom Interceptor could be used instead of Action code.
 

Thanks for the link.  I started looking at implementing a custom interceptor
and think it's a much better solution for me than putting the code in the
action.  However, now I'm having the problem that I can't figure out how to
access the HTTP request headers from the interceptor.  Is
ServletRequestAware meant to be used only in Actions?  I am receiving a null
HTTP Request Servlet in my Interceptor.  Also, I have included a portion of
my struts.xml file below.  I am using servlet-config, so I'm not sure why
the object is not being set.

interceptors
interceptor name=wireless
class=com.sherwin.whitePages.interceptor.WirelessInterceptor/
interceptor-stack name=customStack
interceptor-ref name=exception/
interceptor-ref name=servlet-config/
interceptor-ref name=i18n/
interceptor-ref name=chain/
interceptor-ref name=checkbox/
interceptor-ref name=params/
interceptor-ref name=conversionError/
interceptor-ref name=wireless/
/interceptor-stack
/interceptors

default-interceptor-ref name=customStack/


-- 
View this message in context: 
http://www.nabble.com/-S2--Accessing-HTTP-Header-tf3907721.html#a11087892
Sent from the Struts - User mailing list archive at Nabble.com.


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



Push vs. Set

2007-05-30 Thread chengas123

I'd like to be able to access the first element of my people list as a person
in a property tag later on in an included page as follows:
s:property value=person.firstName /
I know that s:property value=people[0].firstName / would work, but I
unfortunately cannot do that because I may enter the page another way in
which I set a person as a request attribute.
Can I use the push or set tags to accomplish this?  I tried s:set
name=person value=people[0] /, but that only works if I change the tag
to s:property value=#person.firstName / which doesn't work if I come
from my action which sets the person variable.

-- 
View this message in context: 
http://www.nabble.com/Push-vs.-Set-tf3844254.html#a10886681
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: [S2] Formatting inside Iterator tag

2007-04-24 Thread chengas123


Mark Menard wrote:
 
 s:text name=format.dates:param name=value value=orderDate
 //s:text
 
 That will do the date, there are some other formats listed on the Wiki I
 think. *shrug*
 
 Mark
 

When I put the exact text you gave me into my .jsp the text format.date is
printed out to the page.  After a little more research it looks like
format.date need to be defined in a properties file somewhere.  Can this be
any properties file or are you referring to struts.properties?  Can I put it
in struts.xml?  What do I set format.date equal to, is there anything I need
to do to make sure it is picked up by Struts, etc.?  If there are detailed
instructions somewhere I'm not opposed to reading a little documentation.  I
just haven't been able to find any with enough detail to help me out. 
Is there any way in which I can do this without messing with a properties
file?



-- 
View this message in context: 
http://www.nabble.com/-S2--Formatting-inside-Iterator-tag-tf3635036.html#a10162415
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: [S2] Formatting inside Iterator tag

2007-04-24 Thread chengas123


Dave Newton-4 wrote:
 
 --- chengas123 [EMAIL PROTECTED] wrote:
 Can this be any properties file or are you referring
 
 to struts.properties?  
 
 It needs to be one of the normal properties files used
 for messages etc. that S2 searches for, where you keep
 the rest of your messages/properties. (So no, I don't
 think struts.properties would work.)
 
 Is there any way in which I can do this without
 messing with a properties file?
 
 I don't know, but that would kind of defeat the
 purpose of having I18N property files; AFAIK the S2
 tags are more or less wrappers around standard Java
 I18N  localization functionality.
 
 The link:
 
 http://java.sun.com/j2se/1.4.2/docs/api/java/text/MessageFormat.html
 
 provided on the s:text.../ reference page goes in to
 a fair amount of detail about the values contained in
 the properties file.
 
 d.
 


Awesome.  Got it working by adding that to a package.properties file.
I have no plans to internationalize this site and it wasn't immediately
obvious to me that formatting would fall under the category of localization
(although I understand why it does), so I'm afraid this was an area I hadn't
made any efforts to learn.
Thanks again for the help.





-- 
View this message in context: 
http://www.nabble.com/-S2--Formatting-inside-Iterator-tag-tf3635036.html#a10164155
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] Formatting inside Iterator tag

2007-04-23 Thread chengas123

I am using the iterator tag as follows:
s:iterator value=orders status=status id=order
  tr
tds:property value=orderid //td
tds:property value=orderDate //td
tds:property value=total //td
  /tr
/s:iterator

This will give me an order date such as 20040513 and a total such as
68.7700 when what I really want is 05/13/2004 and $68.77.  I have not been
able to figure out how to do this.  Any recommendations?

-- 
View this message in context: 
http://www.nabble.com/-S2--Formatting-inside-Iterator-tag-tf3635036.html#a10150309
Sent from the Struts - User mailing list archive at Nabble.com.


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