struts2-namespace

getting error “There is no Action mapped for namespace / and action name LoginAction” in struts2

ⅰ亾dé卋堺 提交于 2020-01-14 03:53:06
问题 My struts.xml is under 'src' and action class is in a package 'login'. Here's my struts.xml: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="example" extends="json-default"> <action name="login" class="login.LoginAction"> <result type="json"/> </action> </package> </struts> My jsp(It is under /LoginEx/WebContent/Login.jsp): <%@ page language

How to apply a global dynamic result path prefix in Struts 2 so can reskin JSPs?

狂风中的少年 提交于 2019-12-25 04:15:41
问题 I have a website using Struts2 as the MVC framework. I need to re-skin the JSPs. I need to have the old JSPs accessible alongside the new JSPs. So I have added a root folder of /newdesign/ and copied all of the existing JSP folders into it. So if I login with the name/value pair ?newdesign=true (for example) I'm the initial request then I can: store this in the user's session and then dynamically add /newdesign/ as a global prefix to the tag in struts.xml that determines if the new or old JSP

HTTP Status 404 - There is no Action mapped for namespace [/] and action name [login] associated with context path [/struts2]

帅比萌擦擦* 提交于 2019-12-22 13:53:29
问题 I have learned theory of Struts2 and now practicing. Facing problems while executing project.I searched in Google in many ways but could not find result.Please help me. Below is the code.Please help me friends... Project structure: web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns

struts2 action not calling properly

半城伤御伤魂 提交于 2019-12-13 03:43:56
问题 On default I want my struts2 app to forward to an action: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <constant name="struts.devMode" value="false" /> <package name="myApp" namespace="/myApp" extends="struts-default"> <action name="Login_*" method="{1}" class="myApp.SessionManager"

How to prevent the wildcard namespace in struts?

左心房为你撑大大i 提交于 2019-12-11 06:40:46
问题 I am facing a problem that I couldn't find a key word for googleing the following situation: <package name="Main" namespace="/" extends="struts-default"> <action name="administrator" class="com.xyz.AdminAction"> <result name="success">/WEB-INF/jsp/admin.jsp</result> </action> </package> The above url should be http://xyz.com/administrator and it works fine. However, if I change the url to http://xyz.com/asdasd/asdasdasd/administrator and it still works, but I can't accept this! So any setting

struts2 Namespace configuration when set a specific context-root

陌路散爱 提交于 2019-12-08 04:25:53
问题 When I set a context-root in weblogic.xml for my application, what is the default namespace for package in struts2? ex: I set <context-root>/home/app/exec</context-root> and I access my app with the following uri: localhost:8081/home/app/exec/index.html insted of localhost:8081/NameOfMyApp/index.html In the other hand I Know that in Struts2 action namespace map to folder structure. Example on the following link: https://www.mkyong.com/struts2/struts-2-namespace-configuration-example-and

There is no Action mapped for namespace / and action name hello

走远了吗. 提交于 2019-12-07 19:59:19
问题 package com.tutorialspoint.struts2; public class HelloWorldAction{ private String name; public String execute() throws Exception { return "success"; } public String getName() { return name; } public void setName(String name) { this.name = name; } } index.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose

HTTP Status 404 - There is no Action mapped for namespace [/] and action name [login] associated with context path [/struts2]

那年仲夏 提交于 2019-12-06 12:03:44
I have learned theory of Struts2 and now practicing. Facing problems while executing project.I searched in Google in many ways but could not find result.Please help me. Below is the code.Please help me friends... Project structure: web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name

There is no Action mapped for namespace / and action name hello

那年仲夏 提交于 2019-12-06 06:14:51
package com.tutorialspoint.struts2; public class HelloWorldAction{ private String name; public String execute() throws Exception { return "success"; } public String getName() { return name; } public void setName(String name) { this.name = name; } } index.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Hello World</title> </head> <body> <h1>Hello World From Struts2</h1> <form

How to compare a single character from url request parameter in Struts 2

安稳与你 提交于 2019-12-02 10:14:29
问题 I am reading the url parameter which has a single character. It will either be Y or N . I have to write a condition to check if it Y or N and do something accordingly. This is what I wrote but does not seem to work (always goes to else). The url is http://wwww.helloworld.com/showInfo?thecountry=us&theconditionTypeInUrl=Y <s:set var="theUrl" value="%{#parameters.theconditionTypeInUrl}" /> <s:if test="%{#theUrl == 'Y'}"> </s:if> <s:else> </s:else> I also tried <s:set var="theUrl" value='%{