This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
but the thing is when i am trying to hit , tricky namespace tries to append to url as http://localhost:8080/struts2-login/tricky/project/createproject.action
I want the URL to be like this http://localhost:8080/struts2-login/project/createproject.action (without tricky namespace)
in my jsp i tried to call my action with different options to remove tricky
1) project/createproject
2) /project/createproject
3)../project/createproject
There's no reason to use "quote" tags around single words. Just put things like that in actual "quotes".
You neglected to mention how you're creating the URLs. If you're using the <s:url> tag and creating a link to an action in another namespace you'll need to use the "namespace" attribute.
sarada bokka
Ranch Hand
Joined: Jan 13, 2010
Posts: 80
posted
0
Thanks for the info.
I am using <s:a action="../project/createproject">create project</s:a>
i am real newbie to struts... why do we use the namespace attribute in the package tag?\
if i remove the namespace attribute i get the following error.
Aug 26, 2012 7:54:55 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: Y:\Program Files\Java\jre7\bin;Y:\Windows\Sun\Java\bin;Y:\Windows\system32;Y:\Windows;Y:/Program Files/Java/jre7/bin/client;Y:/Program Files/Java/jre7/bin;Y:/Program Files/Java/jre7/lib/i386;Y:\oraclexe\app\oracle\product\11.2.0\server\bin;;Y:\Windows\system32;Y:\Windows;Y:\Windows\System32\Wbem;Y:\Windows\System32\WindowsPowerShell\v1.0\;Y:\eclipse-jee-indigo-SR2-win32\eclipse;;.
Aug 26, 2012 7:54:56 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.serveremoStruts' did not find a matching property.
Aug 26, 2012 7:54:56 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-5000
Aug 26, 2012 7:54:56 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 442 ms
Aug 26, 2012 7:54:56 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Aug 26, 2012 7:54:56 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
Aug 26, 2012 7:54:56 PM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
INFO: Parsing configuration file [struts-default.xml]
Aug 26, 2012 7:54:56 PM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
INFO: Parsing configuration file [struts-plugin.xml]
Aug 26, 2012 7:54:56 PM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider register
INFO: Parsing configuration file [struts.xml]
Aug 26, 2012 7:54:56 PM org.apache.struts2.config.Settings getLocale
WARNING: Settings: Could not parse struts.locale setting, substituting default VM locale
Aug 26, 2012 7:54:56 PM com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory <clinit>
INFO: Setting DefaultObjectTypeDeterminer as default ...
Aug 26, 2012 7:54:56 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-5000
Aug 26, 2012 7:54:56 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Aug 26, 2012 7:54:56 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16 config=null
Aug 26, 2012 7:54:56 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 766 ms
Aug 26, 2012 7:54:58 PM org.apache.struts2.components.Form evaluateExtraParamsServletRequest
WARNING: No configuration found for the specified action: 'hello' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
Aug 26, 2012 7:54:58 PM org.apache.struts2.components.Form evaluateExtraParamsServletRequest
WARNING: No configuration found for the specified action: 'hello' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
my struts.xml file is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts SYSTEM "struts-2.0.dtd" >
<struts>