File tree Expand file tree Collapse file tree
wildcard-method-selection/src/main
java/org/apache/struts/tutorials/wildcardmethod/action Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import org .apache .struts .tutorials .wildcardmethod .model .Person ;
66import org .apache .struts .tutorials .wildcardmethod .service .PersonService ;
77import org .apache .struts2 .ActionSupport ;
8+ import org .apache .struts2 .interceptor .parameter .StrutsParameter ;
89
910import java .util .List ;
1011
@@ -68,7 +69,7 @@ public String delete() {
6869 return SUCCESS ;
6970 }
7071
71-
72+ @ StrutsParameter ( depth = 1 )
7273 public Person getPerson () {
7374 return person ;
7475 }
@@ -93,7 +94,7 @@ public int getId() {
9394 return id ;
9495 }
9596
96-
97+ @ StrutsParameter
9798 public void setId (int id ) {
9899 this .id = id ;
99100 }
Original file line number Diff line number Diff line change 77
88 <constant name =" struts.devMode" value =" false" />
99 <constant name =" struts.enable.DynamicMethodInvocation" value =" false" />
10+ <constant name =" struts.allowlist.packageNames" value =" org.apache.struts.tutorials.wildcardmethod.model" />
1011
1112 <package name =" wildcardmethodexample" extends =" struts-default" >
1213
14+ <default-action-ref name =" index" />
15+ <action name =" index" >
16+ <result >index.jsp</result >
17+ </action >
1318 <!-- Whatever value is before Person for the name of
1419 the action will be the name of the method to call in
1520 class PersonAction. For example action createPerson
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <web-app id =" WebApp_ID" version =" 2.4" xmlns =" http://java.sun.com/xml/ns/j2ee" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
2+ <web-app id =" WebApp_ID" version =" 6.0"
3+ xmlns=" https://jakarta.ee/xml/ns/jakartaee"
4+ xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
5+ xsi:schemaLocation=" https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd" >
36<display-name >Wildcard_Method_Struts2_Mvn</display-name >
47
58 <welcome-file-list >
Original file line number Diff line number Diff line change 1- <%@ page language =" java" pageEncoding =" ISO-8859-1 " %>
1+ <%@ page language =" java" pageEncoding =" UTF-8 " %>
22<%
33String path = request. getContextPath();
44String basePath = request. getScheme()+ " ://" + request. getServerName()+ " :" + request. getServerPort()+ path+ " /" ;
Original file line number Diff line number Diff line change 1- <%@ page language =" java" pageEncoding =" ISO-8859-1 " %>
1+ <%@ page language =" java" pageEncoding =" UTF-8 " %>
22<%
33String path = request. getContextPath();
44String basePath = request. getScheme()+ " ://" + request. getServerName()+ " :" + request. getServerPort()+ path+ " /" ;
You can’t perform that action at this time.
0 commit comments