0

response.java

HttpServletResponse response = ServletActionContext.getResponse();
response.setStatus(400);
return json;

struts.xml

<package name="callresponse" namespace="/" extends="struts-default">
    <action name="response" method="response" class="response.action">
        <result name="json">/WEB-JSP/json.jsp</result>
    </action>
</package> 

web.xml

<error-page>
    <error-code>400</error-code>
    <location>/WEB-JSP/error.jsp</location>
</error-page>

error.jsp

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
Custom Error Page!!!!

can see the error page on localhost. But when I put it on the server and call the domain, it only sends BadRequest. The server was configured with IIS + Tomcat.

tora
  • 17
  • 3

0 Answers0