0

谁能告诉我如何在我的struts2应用程序中调用webservice..我在struts2中创建了登录页面所以我需要访问web服务来验证,如果再次成功需要调用web服务来获取数据并在jsp中显示项目页面

4

1 回答 1

0

打开您的 struts.xml 文件并指定如下操作:

<action class="CLASSNAME"
        name="ACTION_NAME" method="METHOD_NAME">
        <interceptor-ref name="authStack" />
        <interceptor-ref name="json">
            <param name="enableSMD">true</param>
        </interceptor-ref>
        <result name="success" type="json" redirect="index.jsp"></result>
    </action>

使用 javascript / jquery post 将凭据发送到上述操作。像平常在 Struts 中写的一样写动作类

于 2015-06-16T12:46:27.420 回答