0
I want to remove first char from property tag in struts2 ex **<property value="name">** which display name #abhijit but I want to remove first char from that value.
我在字符串中添加了該字符串。 我想要傳遞該值作爲請求參數,以獲得所有與 匹配的記錄。但由於該特殊字符,我不在動作類中創建值。 這裏是動作類代碼。如何從struts2屬性標籤中刪除字符
HttpServletRequest request = (HttpServletRequest) ActionContext.getContext()
.get(ServletActionContext.HTTP_REQUEST);
try {
request.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
String tagname=request.getParameter("name");
System.out.println("tag to search:"+tagname);
在控制檯
標籤搜索:
http:// localhost:8080/project/result?name =#newone –