Re: What is the S2 equivalent
Thanks, Yes I do agree with you, Reason for this question is still we have not mixed JSTL with S2, I thought can we get this going with S2 tags, it would have been cleaner. thanks --- Don Brown <[EMAIL PROTECTED]> wrote: > Use the JSTL tag. The Struts 2 tags aren't meant to > replace JSTL, but > complement it in ways that are useful. There are > several tags that do > overlap with JSTL, such as the iterator tag, but > they are kept mainly > to keep backwards-compatibility. > > Don > > On 9/4/07, tom tom <[EMAIL PROTECTED]> wrote: > > Hi, > > > > In S2, how can we import a remote URL or file > inside a > > JSP. > > > > JSTL I think we can use c:import, what is the S2 > > equivalent of that. > > > > Thanks, > > > > > > > > > Ready > for the edge of your seat? > > Check out tonight's top picks on Yahoo! TV. > > http://tv.yahoo.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] > > Got a little couch potato? Check out fun summer activities for kids. http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What is the S2 equivalent
Use the JSTL tag. The Struts 2 tags aren't meant to replace JSTL, but complement it in ways that are useful. There are several tags that do overlap with JSTL, such as the iterator tag, but they are kept mainly to keep backwards-compatibility. Don On 9/4/07, tom tom <[EMAIL PROTECTED]> wrote: > Hi, > > In S2, how can we import a remote URL or file inside a > JSP. > > JSTL I think we can use c:import, what is the S2 > equivalent of that. > > Thanks, > > > > Ready > for the edge of your seat? > Check out tonight's top picks on Yahoo! TV. > http://tv.yahoo.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]
What is the S2 equivalent
Hi, In S2, how can we import a remote URL or file inside a JSP. JSTL I think we can use c:import, what is the S2 equivalent of that. Thanks, Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. http://tv.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using checkboxes
Hello I'm trying to use checkboxes for a service/product selection. But following the documentation I wasn't able to set the value of each option. My code: Resulting in Service1 Shouldn't the value attribute be set to whatever the id of my service is set to? Why is value="true" instead of my service id? How do I recover this in my action to find what wich services where selected by the user? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can you specify the name of struts.xml for Struts2?
Yes, the way to specify the location is the 'config' parameter in web.xml, however, it will try to load the path from the classpath, not the webapp root. If you do specify it, it is recommended to add to the existing - 'struts-default.xml,struts-plugin.xml,struts.xml' - rather than replacing it, as features like plugins will fail to work. Specifying 'config' in web.xml is a per-web app setting, so specifying it in two webapps should be ok. Don On 8/31/07, Lane, Ron <[EMAIL PROTECTED]> wrote: > Zarar, > This probably won't do the trick, since the classpath is for the entire > Java Application server, and struts.properties is then for the entire > Java App server. Then the new name of struts.xml would apply to all the > web apps in the Java app server. We need a parm that is in web.xml, so > it is specific to the web application, so each web app could have its > own name for struts.xml. This is in essence what the config "init" parm > in web.xml did for Struts1 - each web app could specify its own name for > the config file. > Ron > > -Original Message- > From: Zarar Siddiqi [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 30, 2007 2:41 PM > To: Struts Users Mailing List > Subject: Re: Can you specify the name of struts.xml for Struts2? > > The struts.configuration.files property in struts.properties at the root > of your classpath can specify struts configuration files using a comma > separated list, by default this property is set to: > > struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.x > ml > > You can change it if you like. > > Zarar > > On 8/30/07, Lane, Ron <[EMAIL PROTECTED]> wrote: > > We're having a problem with Struts2 running under Jrun. > > The 'web application class loader' in Jrun is not finding struts.xml > > in WEB-INF/classes. > > We can put struts.xml in the overall classpath of the Java application > > > server, but then that means only one per Java app server. > > > > 1. Has anyone else experienced this problem and have a solution or > > workaround? > > 2. In Struts-1, one could specify a name of the struts config file - > > is there a way in web.xml to specify an alternative name of > struts.xml? > > That way each of the web apps can specify its unique name, and even > > though all the config files are in the overall classpath, they can be > > unique per web app by having a unique name. > > > > Ron Lane > > > > - > > 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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Wildcard action name that includes slashes?
Use two astrisks - '**' Don On 9/4/07, Neil Aggarwal <[EMAIL PROTECTED]> wrote: > Hello: > > In my struts.xml, I have this property: > > > > At the very end of my actions, I have this one: > > > page.products > > > This works if I have a url with a non-slash action name: > http://cbsweb.jammconsulting.com/cbsweb/nonExistent.action > loads the page I want. > > But, if I have an action name with a slash in it: > http://cbsweb.jammconsulting.com/cbsweb/test/nonExistent.action > I get this error: > [TP-Processor3] ERROR org.apache.struts2.dispatcher.Dispatcher - Could not > find action or result > There is no Action mapped for action name test/nonExistent. - [unknown > location] > at > com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1 > 86) > > But, if I add this action to my struts.xml: > > page.products > > It brings up the correct page. > > Is there a way to have a wildcard that will match anything from > the url even if there are slashes in it? > > Thanks, > Neil > > -- > Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com > Eliminate junk email and reclaim your inbox. > Visit http://www.spammilter.com for details. > > > - > 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]
Formating dates and numbers
Hello How do I format dates and numbers with Struts2? I tried following this tutorial found on documentation but it didn't work. Could anyone point me to a working example or tell me how to do it. I did not want to have to create methods to format dates and numbers in my action. http://struts.apache.org/2.x/docs/how-to-format-dates-and-numbers.html Thanks... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can you specify the name of struts.xml for Struts2?
Should I open up a JIRA issue? Please explain how to do that and what it means. Thanks, Ron -Original Message- From: James Holmes [mailto:[EMAIL PROTECTED] Sent: Thursday, August 30, 2007 5:00 PM To: 'Struts Users Mailing List' Subject: RE: Can you specify the name of struts.xml for Struts2? If you find things that are documented to work and don't, please open JIRA issues and we'll get them fixed. James -Original Message- From: mraible [mailto:[EMAIL PROTECTED] Sent: Thursday, August 30, 2007 4:37 PM To: user@struts.apache.org Subject: Re: Can you specify the name of struts.xml for Struts2? It looks like the FilterDispatcher supports a "config" init-parameter as well. However, I tried setting it to /WEB-INF/struts.xml and it didn't work for me. http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dis patc her/FilterDispatcher.html Matt Zarar Siddiqi wrote: > > The struts.configuration.files property in struts.properties at the > root of your classpath can specify struts configuration files using a > comma separated list, by default this property is set to: > > struts.configuration.files=struts-default.xml,struts-plugin.xml,struts > .xml > > You can change it if you like. > > Zarar > > On 8/30/07, Lane, Ron <[EMAIL PROTECTED]> wrote: >> We're having a problem with Struts2 running under Jrun. >> The 'web application class loader' in Jrun is not finding struts.xml >> in WEB-INF/classes. >> We can put struts.xml in the overall classpath of the Java >> application server, but then that means only one per Java app server. >> >> 1. Has anyone else experienced this problem and have a solution or >> workaround? >> 2. In Struts-1, one could specify a name of the struts config file - >> is there a way in web.xml to specify an alternative name of struts.xml? >> That way each of the web apps can specify its unique name, and even >> though all the config files are in the overall classpath, they can be >> unique per web app by having a unique name. >> >> Ron Lane >> >> - >> 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/Can-you-specify-the-name-of-struts.xml-for-Struts2 --tf 4355855.html#a12415685 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: Struts and JNDI
(Mary Poppins: 'Practically Perfect in Every Way') This is a complicated scenario, what with a private static final ThreadLocal in a class with a public constructor. Without coding it and tracing the ThreadLocal context, my guess is that the ThreadLocal is not being carried thru the various requests, as it is specific to the thread which created it, even though as a static final object, you would normally expect it to exist for all class instances. You might try 2 things: (1) make the class a singleton, and remove the ThreadLocal context for the Factory, or (2) use the 'ServiceLocator' pattern from the 'Core J2EE Patterns' book, now available on-line from Sun. Is there a reason to use ThreadLocal context here? Sorry I couldn't be more helpful. - Ray Clough > - Original Message - > From: "Mary Poppins" <[EMAIL PROTECTED]> > To: user@struts.apache.org > Subject: Struts and JNDI > Date: Mon, 3 Sep 2007 05:57:30 -0700 (PDT) > > > > I have a struts application, deployed using tomcat 5, that uses database > pooling. I have a helper class called DAOhelper that encapsulates database > interactions. The problem I have is that the class only works during > application initialisation. I have an ApplicationInitaliser class that > extends Plugin. In this class I can use my DAOHelper to acces the database, > however the class does not work when invoked in an action. > > The DAOhelper class contains the following method > > private static DataSource getDataSource() throws DAOException > { > logger.debug(IConstants.ENTERING); > DataSource dataSource = null; > > try > { > Context initCtx = new InitialContext(); > Context envCtx = (Context) initCtx.lookup("java:comp/env"); > > //Look up our data source > dataSource = (DataSource)envCtx.lookup("jdbc/Frontline"); > > logger.debug("DataSource retrieved successfully"); > } > catch (NamingException e) > { > String errorMessage = IConstants.DATA_SOURCE_ERROR + " using > context > jdbc/Frontline"; > logger.error(errorMessage); > logger.error(e.getMessage(),e); > throw new DAOException(errorMessage,e); > } > > logger.debug(IConstants.EXITING); > return dataSource; > } > > The line Context envCtx = (Context) initCtx.lookup("java:comp/env"); throws > a javax.naming.NameNotFoundException when the class is used inside an > action, but works fine during initialising in the init method. > > The excpetion message is Name java:comp is not bound in this Context. > > Can anyone tell me why this is happening? What I don't understand is how I > can successfully get a connection from within my ApplicationInitialiser > class and cannot get an connetion within an action. > > The complete clas listing is below. > > /** > * > */ > package com.lagan.ini.thinclient.usermanagement; > > import java.io.IOException; > import java.io.InputStream; > import java.util.Properties; > > import javax.naming.Context; > import javax.naming.InitialContext; > import javax.naming.NamingException; > import javax.sql.DataSource; > > import org.apache.log4j.Logger; > > import com.lagan.ini.frontlinedata.IConstants; > import com.lagan.ini.frontlinedata.dao.DAOException; > import com.lagan.ini.frontlinedata.dao.IDAOFactory; > import com.lagan.ini.frontlinedata.dao.IDao; > import com.lagan.ini.frontlinedata.dao.IDivisionDAO; > import com.lagan.ini.frontlinedata.dao.IJobTitleDAO; > import com.lagan.ini.frontlinedata.dao.ITeamDAO; > import com.lagan.ini.frontlinedata.dao.IUserDAO; > import com.lagan.ini.frontlinedata.dao.IUserInfoDAO; > import com.lagan.ini.frontlinedata.jdbcdao.JDBCDaoFactory; > > /** > * @author SeanMcE > * > */ > public class DAOHelper > { > > // > //Private Members > // > > private static Logger logger = Logger.getLogger(DAOHelper.class); > > private static final ThreadLocal threadDaoFactory > = new ThreadLocal(); > > // > //Constructors > // > /** >* >*/ > public DAOHelper() > { > } > > // > //Public Methods > // > > public static IUserDAO getUserDAO() throws DAOException > { > return getDAOFactory().getUserDAO(); > } > > public static IUserInfoDAO getUserInfoDAO() throws DAOException > { > return getDAOFactory().getUserInfoDAO(); > } > >
Sorting Problem with Displaytag and Struts2
Hi, I use Displaytag and want to use the sorting capability. So I configured the displaytag to go to a empty action, because my list is in the session - nothing should be loaded again, just using the existing search results. If I do this, I get a 404 error that the ressource which is defined in my struts.xml could not be found. I debugged the execution of the action and struts goes into the action and returns the "success" string" and I get the error. If I put just an empty string into requestURI of the displaytag the action which performs the search and returns the searchresults by putting a collection into the session returns to the jsp without the ressource not found error. But I looked into the empty action and my searchresults were still in the session. The empty action in the struts.xml /involved_party_search.jsp And the working action: /WEB-INF/jsp/searchInvolvedParty.jsp /WEB-INF/jsp/error.jsp /WEB-INF/jsp/searchInvolvedParty.jsp /WEB-INF/jsp/showParamHelp.jsp And the java code: package de.seb.bpc.search.presentation; . public class SearchAction extends SearchSupport { public String internalSearch() throws Exception { log.debug("internalSearch "); /*if (getUserId() == null) return "errorUserId";*/ ArrayList errorList = InputParamValidator.validate (getInputParameters()); if (errorList.size() > 0) { for (int i=0 ; i < errorList.size(); i++) { log.error(getText(errorList.get(i))); addActionError(getText(errorList.get(i))); } return "showParamHelp"; } clearSimpleSearchDefaultValue(getSearchCriteria()); setSelectedIpFromGlobalContext(); clearSeachResults(); getSearchCriteria().trim(); log.debug("internalSearch: \n" + getSearchCriteria().toString()); log.debug("searchTypeString: " + getSearchTypeString()); // validate the given searchCriteria, the searchType is returned // the validation resets the searchCriteria of all not selected tabs !!! SearchType searchType = SearchType.valueOf(this.getSearchTypeString ()); searchType = SearchCriteriaValidator.validateSearchCriteria (getSearchCriteria(),searchType); log.debug("searchType after validation: " + searchType); // add actionErrors if searchCriteria not valid if (SearchCriteriaValidator.getErrorList().size() > 0) { log.error("validation of searchCriteria not successful"); //setActionErrors(SearchCriteriaValidator.getErrorList()); for (int i=0 ; i < SearchCriteriaValidator.getErrorList().size(); i++) { log.error(getText(SearchCriteriaValidator.getErrorList ().get(i))); addActionError(getText(SearchCriteriaValidator.getErrorList ().get(i))); } return "errorValidation"; } // perform search try { SearchResults results = SearchDispatcher.performSearch(searchType, getUserId(), getSearchCriteria()); if (!results.hasErrorMessages()) { setSearchResults (results.getInvolvedParties()); if (results.isMoreDataAvaible()) { addActionMessage(getText("info.search.more.data")); } } else { Iterator it = (Iterator)results.getErrorMessages().iterator(); while (it.hasNext()) addActionError(it.next()); } } catch (ServiceAdapterException saex) { addActionError(getText("error.search.intern.severe")+" : "+saex.getMessage()+" | Returncode: "+saex.getReturnCode()); } catch (Exception ex) { if (searchType.equals(Constants.SearchType.SEARCH_BY_NAME) && ( ex.getMessage().indexOf("TIMEOUT: no messages received") != -1)) { String[] args = {PropertyUtil.getInitParameter(" searchByName.timeout")}; addActionError(getText("error.search.timeout", args)); } else throw ex; } // if nothing found set action message if(getSearchResults() == null) { addActionMessage(getText("info.search.not.found")); } return "success"; } public String showResultList() { log.debug("showResultList"); return "success"; } } At the end for forwarding to the right jsp just the return string should matter - or am I wrong? I have no glue what is wrong :-( Best Regards, Marc
Fwd: Re: sending values to form when using ValidateDispatchAction
iam sorry that was LookupDispatchAction, not ValidateDispatchAction.. abhiram - Once upon a time there was 1 GB storage in your inbox. Click here for happy ending.
[S2] Wildcard action name that includes slashes?
Hello: In my struts.xml, I have this property: At the very end of my actions, I have this one: page.products This works if I have a url with a non-slash action name: http://cbsweb.jammconsulting.com/cbsweb/nonExistent.action loads the page I want. But, if I have an action name with a slash in it: http://cbsweb.jammconsulting.com/cbsweb/test/nonExistent.action I get this error: [TP-Processor3] ERROR org.apache.struts2.dispatcher.Dispatcher - Could not find action or result There is no Action mapped for action name test/nonExistent. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1 86) But, if I add this action to my struts.xml: page.products It brings up the correct page. Is there a way to have a wildcard that will match anything from the url even if there are slashes in it? Thanks, Neil -- Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com Eliminate junk email and reclaim your inbox. Visit http://www.spammilter.com for details. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Running Dojo on a struts project
Thanks for the input Frank. I found out my mistake, I didn't have the scripts in the header section, they were in the body, that's why the djConfig wasn't going through properly. Thanks, Session > It *looks* like your using a Dojo profile that doesn't include the pieces > you need, and Dojo is going off and trying to import them and not finding > them. Have a look here: > > http://www.nabble.com/djConfig-params-t2109960.html > > You should set djConfig.baseScriptUri first, see if that resolves your > problem, then think about the profile your using. > > Frank > > -- Frank W. Zammetti Founder and Chief Software Architect Omnytex > Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: > [EMAIL PROTECTED] Author of "Practical Ajax Projects With Java > Technology" (2006, Apress, ISBN 1-59059-695-1) and "JavaScript, DOM > Scripting and Ajax Projects" (2007, Apress, ISBN 1-59059-816-4) Java Web > Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you > don't have to reinvent it! > > Session A Mwamufiya wrote: >> Who has experience using Dojo? Please help me get it setup. I added >> the dojo.js file from the 0.9.0 release (I think it's the latest) to my >> webcontent folder in an eclipse WAP project, but firebug keeps giving >> me the same error "djConfig.baseScriptUri has no properties >> getBaseScriptUri()dojo.js (line 155)" >> >> Please help, >> >> Thanks, Session >> >> >>> To follow up on this; I used firebug to try to figure out what was >>> going on, and this is the error message I get in the console: >>> >>> djConfig.baseScriptUri has no properties getBaseScriptUri()dojo.js >>> (line 155) loadPath("src/lang/__package__.js", "dojo.lang", >>> undefined)dojo.js (line 187) loadModule("dojo.lang", undefined, >>> undefined)dojo.js (line 341) require("dojo.lang.*")dojo.js (line 419) >>> [Break on this error] if(djConfig.baseScriptUri.length){ >>> >>> There seems to be an error in the dojo.js file. I'm using version >>> 0.4.3 with ajax. Can someone send me the link to a working version of >>> the file? >>> >>> Thanks, >>> >>> Session A. Mwamufiya Carnegie Mellon University MBA | Tepper School >>> of Business MSE (software eng.) | School of Computer Science T: (412) >>> 508-5455 | [EMAIL PROTECTED] >>> >>> -Original Message- From: Session A Mwamufiya >>> [mailto:[EMAIL PROTECTED] Sent: Monday, September 03, 2007 >>> 9:08 AM To: user@struts.apache.org Subject: Running Dojo on a struts >>> project >>> >>> Hi, >>> >>> I'm attempting to follow a Dojo tree widget tutorial, >>> http://willcode4beer.com/ware.jsp?set=dojoTreeWidget, where Dojo is >>> used to define a tree. Unfortunately nothing comes up on the page, >>> even though the page source shows the tree definition. >>> >>> The tree page is set as the result page for a dummy action (which >>> executes), but that's the only connection I have between Dojo and >>> struts. Is there anything in particular I need to do to get Dojo to >>> run within a struts app? >>> >>> Thanks, Session >>> >>> >>> - >>> 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] >>> >>> >>> >> >> >> - 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] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
sending values to form when using ValidateDispatchAction
iam using ValidateDispatchAction to handle multiple submit buttons in a form. in this form, i display images and a submit for each of them. i want the id of the image(which i already have in the form) to be submitted to the form-bean on clicking the corresponding submit button. problem is that if i use ValidateDispatchAction, i have to set parameter="method" to each of the button.(i thought of sending the image id through this way). now even if i write a hidden field and click submit,the ids of all photos will be submitted. is there a way in wch i can send the id of only that photo when the corresponding submit is pressed in this case ? please help abhiram - Get the freedom to save as many mails as you wish. Click here to know how.
Re: Running Dojo on a struts project
It *looks* like your using a Dojo profile that doesn't include the pieces you need, and Dojo is going off and trying to import them and not finding them. Have a look here: http://www.nabble.com/djConfig-params-t2109960.html You should set djConfig.baseScriptUri first, see if that resolves your problem, then think about the profile your using. Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of "Practical Ajax Projects With Java Technology" (2006, Apress, ISBN 1-59059-695-1) and "JavaScript, DOM Scripting and Ajax Projects" (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! Session A Mwamufiya wrote: Who has experience using Dojo? Please help me get it setup. I added the dojo.js file from the 0.9.0 release (I think it's the latest) to my webcontent folder in an eclipse WAP project, but firebug keeps giving me the same error "djConfig.baseScriptUri has no properties getBaseScriptUri()dojo.js (line 155)" Please help, Thanks, Session To follow up on this; I used firebug to try to figure out what was going on, and this is the error message I get in the console: djConfig.baseScriptUri has no properties getBaseScriptUri()dojo.js (line 155) loadPath("src/lang/__package__.js", "dojo.lang", undefined)dojo.js (line 187) loadModule("dojo.lang", undefined, undefined)dojo.js (line 341) require("dojo.lang.*")dojo.js (line 419) [Break on this error] if(djConfig.baseScriptUri.length){ There seems to be an error in the dojo.js file. I'm using version 0.4.3 with ajax. Can someone send me the link to a working version of the file? Thanks, Session A. Mwamufiya Carnegie Mellon University MBA | Tepper School of Business MSE (software eng.) | School of Computer Science T: (412) 508-5455 | [EMAIL PROTECTED] -Original Message- From: Session A Mwamufiya [mailto:[EMAIL PROTECTED] Sent: Monday, September 03, 2007 9:08 AM To: user@struts.apache.org Subject: Running Dojo on a struts project Hi, I'm attempting to follow a Dojo tree widget tutorial, http://willcode4beer.com/ware.jsp?set=dojoTreeWidget, where Dojo is used to define a tree. Unfortunately nothing comes up on the page, even though the page source shows the tree definition. The tree page is set as the result page for a dummy action (which executes), but that's the only connection I have between Dojo and struts. Is there anything in particular I need to do to get Dojo to run within a struts app? Thanks, Session - 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] - 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: Running Dojo on a struts project
Who has experience using Dojo? Please help me get it setup. I added the dojo.js file from the 0.9.0 release (I think it's the latest) to my webcontent folder in an eclipse WAP project, but firebug keeps giving me the same error "djConfig.baseScriptUri has no properties getBaseScriptUri()dojo.js (line 155)" Please help, Thanks, Session > To follow up on this; I used firebug to try to figure out what was going > on, and this is the error message I get in the console: > > djConfig.baseScriptUri has no properties getBaseScriptUri()dojo.js (line > 155) loadPath("src/lang/__package__.js", "dojo.lang", undefined)dojo.js > (line 187) loadModule("dojo.lang", undefined, undefined)dojo.js (line 341) > require("dojo.lang.*")dojo.js (line 419) [Break on this error] > if(djConfig.baseScriptUri.length){ > > There seems to be an error in the dojo.js file. I'm using version 0.4.3 > with ajax. Can someone send me the link to a working version of the > file? > > Thanks, > > Session A. Mwamufiya Carnegie Mellon University MBA | Tepper School of > Business MSE (software eng.) | School of Computer Science T: (412) 508-5455 > | [EMAIL PROTECTED] > > -Original Message- From: Session A Mwamufiya > [mailto:[EMAIL PROTECTED] Sent: Monday, September 03, 2007 9:08 AM > To: user@struts.apache.org Subject: Running Dojo on a struts project > > Hi, > > I'm attempting to follow a Dojo tree widget tutorial, > http://willcode4beer.com/ware.jsp?set=dojoTreeWidget, where Dojo is used > to define a tree. Unfortunately nothing comes up on the page, even though > the page source shows the tree definition. > > The tree page is set as the result page for a dummy action (which > executes), but that's the only connection I have between Dojo and struts. > Is there anything in particular I need to do to get Dojo to run within a > struts app? > > Thanks, Session > > > - 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] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: MVC2 question
On 9/3/07, Alexandre Seabra <[EMAIL PROTECTED]> wrote: > Leon, > > Frist of all, I wanna say hi to the community. I just sign in the > list, and hope we have a good time! welcome aboard. > > I don't remember reading a book about MVC2, but informaly, with > friends at work, this subject comes up some times. The MVC2 is not > doesn 't depend on struts. Struts uses is implemented using its > strategy. In youu message, topic 5, talk about the essetial part of > MVC2. You don't need to map all servelts. You can map ALL requests to > one same servelt and use a factory command pattern so take you request > (same strategy that actions are created). > The fact that there is only one controlled entrance to you program, > tell if you have a MVC or MVC2. > I hope I made myself clear. Well. I've read another definition from sun: The MVC2 architecture is actually a modified MVC implementation. The major modification is that the Model no longer fires events to its Views. http://www.sun.com/software/sunone/docs/arch/chapter8.pdf However its just another buzzword they tried to invent... (Especially since they totally screwed the MVC1 definition). Patterns are guidelines. There are thousands of ways to implement same pattern for a special case. We really don't need to invent a new name each time. Otherwise we'll have MVC150 by tomorrow. regards Leon > > Alexandre > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Running Dojo on a struts project
To follow up on this; I used firebug to try to figure out what was going on, and this is the error message I get in the console: djConfig.baseScriptUri has no properties getBaseScriptUri()dojo.js (line 155) loadPath("src/lang/__package__.js", "dojo.lang", undefined)dojo.js (line 187) loadModule("dojo.lang", undefined, undefined)dojo.js (line 341) require("dojo.lang.*")dojo.js (line 419) [Break on this error] if(djConfig.baseScriptUri.length){ There seems to be an error in the dojo.js file. I'm using version 0.4.3 with ajax. Can someone send me the link to a working version of the file? Thanks, Session A. Mwamufiya Carnegie Mellon University MBA | Tepper School of Business MSE (software eng.) | School of Computer Science T: (412) 508-5455 | [EMAIL PROTECTED] -Original Message- From: Session A Mwamufiya [mailto:[EMAIL PROTECTED] Sent: Monday, September 03, 2007 9:08 AM To: user@struts.apache.org Subject: Running Dojo on a struts project Hi, I'm attempting to follow a Dojo tree widget tutorial, http://willcode4beer.com/ware.jsp?set=dojoTreeWidget, where Dojo is used to define a tree. Unfortunately nothing comes up on the page, even though the page source shows the tree definition. The tree page is set as the result page for a dummy action (which executes), but that's the only connection I have between Dojo and struts. Is there anything in particular I need to do to get Dojo to run within a struts app? Thanks, Session - 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: MVC2 question
Leon, Frist of all, I wanna say hi to the community. I just sign in the list, and hope we have a good time! I don't remember reading a book about MVC2, but informaly, with friends at work, this subject comes up some times. The MVC2 is not doesn 't depend on struts. Struts uses is implemented using its strategy. In youu message, topic 5, talk about the essetial part of MVC2. You don't need to map all servelts. You can map ALL requests to one same servelt and use a factory command pattern so take you request (same strategy that actions are created). The fact that there is only one controlled entrance to you program, tell if you have a MVC or MVC2. I hope I made myself clear. Alexandre On 9/3/07, Leon Rosenberg <[EMAIL PROTECTED]> wrote: > 1) there is no such thing as MVC2. > You are probably mixing things up: Model2 for JSP Development and MVC Pattern. > > 2) If you are talking about struts 2, there is a major difference > between a servlet and an action, since the action incorporates both, > request data and logic, which servlet doesnt. > > 3) If you are talking about struts 1, you have to take in mind, that a > servlet is much more heavyweighted as an action. > You can't control the servlet's creation, what you can do with > actions, since you (or the framework for you) are creating the action > at the point they are needed. > You can't control number of the instances of the servlet, its servlet > containers decision. > > 4) if you stick with the servlet interface you have to manage request > dispatching yourself in each servlet, again and again. > > 5) You have to map each servlet in the web.xml, blowing it for an app > which has like 100 actions. > > 6) It's easier to create a class hierachy with actions as with > servlets (still its possible with servlets too), sharing generic > methods across actions. > > 7) it's easier to test it with mock objects. > > 8). It just looks better :-) > > Leon > > On 9/1/07, debussy007 <[EMAIL PROTECTED]> wrote: > > > > > > Instead of having one front servlet, have one servlet for one action. > > Sounds more oriented object to me. > > > > > > newton.dave wrote: > > > > > > --- debussy007 <[EMAIL PROTECTED]> wrote: > > >> what is the benfit of having the front controller > > >> dispatching the request to the appropriate > > > controllers? > > >> Why not calling the appropriate controller directly? > > > > > > How would you do that? > > > > > > d. > > > > > > > > > > > > > > > > > > Shape Yahoo! in your own image. Join our Network Research Panel today! > > > http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > -- > > View this message in context: > > http://www.nabble.com/MVC2-question-tf4219667.html#a12437988 > > 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] > > -- Atenciosamente, Alexandre Seabra. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Running Dojo on a struts project
Hi, I'm attempting to follow a Dojo tree widget tutorial, http://willcode4beer.com/ware.jsp?set=dojoTreeWidget, where Dojo is used to define a tree. Unfortunately nothing comes up on the page, even though the page source shows the tree definition. The tree page is set as the result page for a dummy action (which executes), but that's the only connection I have between Dojo and struts. Is there anything in particular I need to do to get Dojo to run within a struts app? Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts and JNDI
I have a struts application, deployed using tomcat 5, that uses database pooling. I have a helper class called DAOhelper that encapsulates database interactions. The problem I have is that the class only works during application initialisation. I have an ApplicationInitaliser class that extends Plugin. In this class I can use my DAOHelper to acces the database, however the class does not work when invoked in an action. The DAOhelper class contains the following method private static DataSource getDataSource() throws DAOException { logger.debug(IConstants.ENTERING); DataSource dataSource = null; try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup("java:comp/env"); //Look up our data source dataSource = (DataSource)envCtx.lookup("jdbc/Frontline"); logger.debug("DataSource retrieved successfully"); } catch (NamingException e) { String errorMessage = IConstants.DATA_SOURCE_ERROR + " using context jdbc/Frontline"; logger.error(errorMessage); logger.error(e.getMessage(),e); throw new DAOException(errorMessage,e); } logger.debug(IConstants.EXITING); return dataSource; } The line Context envCtx = (Context) initCtx.lookup("java:comp/env"); throws a javax.naming.NameNotFoundException when the class is used inside an action, but works fine during initialising in the init method. The excpetion message is Name java:comp is not bound in this Context. Can anyone tell me why this is happening? What I don't understand is how I can successfully get a connection from within my ApplicationInitialiser class and cannot get an connetion within an action. The complete clas listing is below. /** * */ package com.lagan.ini.thinclient.usermanagement; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; import org.apache.log4j.Logger; import com.lagan.ini.frontlinedata.IConstants; import com.lagan.ini.frontlinedata.dao.DAOException; import com.lagan.ini.frontlinedata.dao.IDAOFactory; import com.lagan.ini.frontlinedata.dao.IDao; import com.lagan.ini.frontlinedata.dao.IDivisionDAO; import com.lagan.ini.frontlinedata.dao.IJobTitleDAO; import com.lagan.ini.frontlinedata.dao.ITeamDAO; import com.lagan.ini.frontlinedata.dao.IUserDAO; import com.lagan.ini.frontlinedata.dao.IUserInfoDAO; import com.lagan.ini.frontlinedata.jdbcdao.JDBCDaoFactory; /** * @author SeanMcE * */ public class DAOHelper { // //Private Members // private static Logger logger = Logger.getLogger(DAOHelper.class); private static final ThreadLocal threadDaoFactory = new ThreadLocal(); // //Constructors // /** * */ public DAOHelper() { } // //Public Methods // public static IUserDAO getUserDAO() throws DAOException { return getDAOFactory().getUserDAO(); } public static IUserInfoDAO getUserInfoDAO() throws DAOException { return getDAOFactory().getUserInfoDAO(); } public static ITeamDAO getTeamDAO() throws DAOException { return getDAOFactory().getTeamDAO(); } public static IDivisionDAO getDivisionDAO() throws DAOException { return getDAOFactory().getDivsionDAO(); } public static IJobTitleDAO getJobTitleDAO() throws DAOException { return getDAOFactory().getJobTitleDAO(); } public static IDAOFactory getDAOFactory() throws DAOException { IDAOFactory daoFactory = getThreadDaoFactory().get(); if(daoFactory == null) { daoFactory = createDaoFactory(); getThreadDaoFactory().set(daoFactory); } return daoFactory; } public static void closeDAOConnection(IDao dao) { if(dao != null) { dao.close(); } } //--
Re: How to give a text field name dynamically?
Thanks Nuwan. It's working. -- View this message in context: http://www.nabble.com/How-to-give-a-text-field-name-dynamically--tf4358482.html#a12460663 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: ServletRequestAware
why can't u get request object from ServletContext? - Original Message - From: "Alvaro Sanchez-Mariscal" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Monday, September 03, 2007 6:53 AM Subject: Re: ServletRequestAware As far as I know, the only way is asking HttpServletRequest, and thus, implementing ServletRequestAware. If you want to keep HttpServletRequest code out of your actions, consider implementing an interceptor, or even a raw servlet filter. Alvaro. On 9/3/07, stanlick <[EMAIL PROTECTED]> wrote: I have an action that determines the requester IP address. The action implements ServletRequestAware, but I don't like it being all tangled up in the Servlet API. Is there a way to get the IP address another way. The RequestAware interface seems to map to only request attributes. Thanks, S -- View this message in context: http://www.nabble.com/ServletRequestAware-tf4369669.html#a12454602 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alvaro Sanchez-Mariscal Arnaiz Java EE Architect & Instructor [EMAIL PROTECTED] - 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: dojo form submission not working in IE
Wow...thank you very much.. its working.. Jeromy Evans - Blue Sky Minds wrote: > > In IE6 the s:a can't have a target equal to a div that contains the > itself unless you set showLoadingText=false > > The problem is that in IE6 the form nodes are overwritten by the loading > text before its actually read and posted. Disable the loading text and > it will be okay. > > regards, > Jeromy Evans > > Hari Prasad wrote: >> Hi, >>I used simple ajax form submission in my application and it worked in >> both Mozilla and Internet Explorer. >>and now, I shifted to DOJO and my form is like this.. >> >> <@s.div id="login_box_ajx" theme="ajax"> >> >> <@s.form action="login" name="login_form" id="login_form" >> method="POST" theme="ajax"> >> <@s.hidden name="test" value="checkthis"/> >> <@s.a theme="ajax" formId="login_form" name="Go" >> targets="login_box_ajx" tooltip="Go"> >> /go_button.gif >> >> >> >> >> >> >> all I want to do is to submit the form and return some data and put it >> into >> the div. >> Its working in Mozilla , but not if IE , the request parameters are not >> comming in IE. >> >> can anyone suggest me what to do? >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/dojo-form-submission-not-working-in-IE-tf4370786.html#a12458439 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: MVC2 question
1) there is no such thing as MVC2. You are probably mixing things up: Model2 for JSP Development and MVC Pattern. 2) If you are talking about struts 2, there is a major difference between a servlet and an action, since the action incorporates both, request data and logic, which servlet doesnt. 3) If you are talking about struts 1, you have to take in mind, that a servlet is much more heavyweighted as an action. You can't control the servlet's creation, what you can do with actions, since you (or the framework for you) are creating the action at the point they are needed. You can't control number of the instances of the servlet, its servlet containers decision. 4) if you stick with the servlet interface you have to manage request dispatching yourself in each servlet, again and again. 5) You have to map each servlet in the web.xml, blowing it for an app which has like 100 actions. 6) It's easier to create a class hierachy with actions as with servlets (still its possible with servlets too), sharing generic methods across actions. 7) it's easier to test it with mock objects. 8). It just looks better :-) Leon On 9/1/07, debussy007 <[EMAIL PROTECTED]> wrote: > > > Instead of having one front servlet, have one servlet for one action. > Sounds more oriented object to me. > > > newton.dave wrote: > > > > --- debussy007 <[EMAIL PROTECTED]> wrote: > >> what is the benfit of having the front controller > >> dispatching the request to the appropriate > > controllers? > >> Why not calling the appropriate controller directly? > > > > How would you do that? > > > > d. > > > > > > > > > > > > Shape Yahoo! in your own image. Join our Network Research Panel today! > > http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: > http://www.nabble.com/MVC2-question-tf4219667.html#a12437988 > 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: dojo form submission not working in IE
In IE6 the s:a can't have a target equal to a div that contains the itself unless you set showLoadingText=false The problem is that in IE6 the form nodes are overwritten by the loading text before its actually read and posted. Disable the loading text and it will be okay. regards, Jeromy Evans Hari Prasad wrote: Hi, I used simple ajax form submission in my application and it worked in both Mozilla and Internet Explorer. and now, I shifted to DOJO and my form is like this.. <@s.div id="login_box_ajx" theme="ajax"> <@s.form action="login" name="login_form" id="login_form" method="POST" theme="ajax"> <@s.hidden name="test" value="checkthis"/> <@s.a theme="ajax" formId="login_form" name="Go" targets="login_box_ajx" tooltip="Go"> /go_button.gif all I want to do is to submit the form and return some data and put it into the div. Its working in Mozilla , but not if IE , the request parameters are not comming in IE. can anyone suggest me what to do? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Animated Tutorial for Struts2
Dear all, In order to better understanding and using of Struts2, I have created the Animated Tutorial for Struts2 that shows how does struts work. My goal for creating this document was to show basic primitives such as request scope value stack, action classes and objects to someone who wants to select between web frameworks such as Struts, JSF, Tapestry and etc. I want you all to inform me about usefulness of this tutorial. http://khorshid.ut.ac.ir/~m.s.alavi/Tutorial.zip First of all you must read the readme.pdf and then start with first scenario. --kind regards Mohammad SeyedAlavi
dojo form submission not working in IE
Hi, I used simple ajax form submission in my application and it worked in both Mozilla and Internet Explorer. and now, I shifted to DOJO and my form is like this.. <@s.div id="login_box_ajx" theme="ajax"> <@s.form action="login" name="login_form" id="login_form" method="POST" theme="ajax"> <@s.hidden name="test" value="checkthis"/> <@s.a theme="ajax" formId="login_form" name="Go" targets="login_box_ajx" tooltip="Go"> /go_button.gif all I want to do is to submit the form and return some data and put it into the div. Its working in Mozilla , but not if IE , the request parameters are not comming in IE. can anyone suggest me what to do? -- View this message in context: http://www.nabble.com/dojo-form-submission-not-working-in-IE-tf4370786.html#a12457717 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2: How to handle errors and messages with ajax requests
Hi Marc, if you are using struts2 , i guess that your action result is xslt (returning xml) . Normally when no errors occur you will parse this xml and populate the list with javascript. Why don't you set a flag on your xml result i.e. 1 Invalid input so that you will test for the value of errorid . If errorid > 0 do not run code that populates list Regards, Leonidas Marc Eckart wrote: Hi, I have no idea, how to handle ajax requests properly. My problem is, that I want to fill a list - by now it's just a simple struts action as normal http request. I now want that the list is filled with a ajax request so that the whole page doesn't need to be loaded. But sometimes it is possible that the action that is responsible to fill the list throws an exception or delivers actionerrors/actionmessages. If the action returns actionerrors this should not displayed in the div tag where the list is. Instead actionerrors are displayed in a different div tag. Or another problem if an exception occurs the errorpage is displayed in the div tag instead on a different error jsp. How can I deal with this situations? Any suggestions? Thanks in advance :-) Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]