0

I am trying to make ajax call from a div using dojo plugins in struts2. I am using the following jars: struts2-core-2.1.8.1.jar

struts2-dojo-plugin-2.1.8.1.jar

I have the following jsp:

    <%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
    <%@ taglib prefix="s" uri="/struts-tags"%>
    <html>
      <head>
        <sx:head/>
      </head>
      <body>
        <sx:div id="loginDiv" theme="ajax">
        <div style="width: 300px;border-style: solid">
          <s:form action="login"  validate="true">        
              <s:textfield name="username" label="Login name"/>
              <s:password name="password" label="Password"/>
              <sx:submit targets="loginDiv" notifyTopics="/login"/>    
          </s:form>
        </div>
        </sx:div>
      </body>
    </html>

But I am getting the following exception:

java.lang.AbstractMethodError
at org.apache.struts2.components.ClosingUIBean.start(ClosingUIBean.java:59)
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:53)
at org.apache.jsp.WEB_002dINF.content.rule.rule_jsp._jspx_meth_sx_submit_0(rule_jsp.java from :253)
at org.apache.jsp.WEB_002dINF.content.rule.rule_jsp._jspx_meth_s_form_0(rule_jsp.java from :186)
at org.apache.jsp.WEB_002dINF.content.rule.rule_jsp._jspx_meth_sx_div_0(rule_jsp.java from :138)
at org.apache.jsp.WEB_002dINF.content.rule.rule_jsp._jspService(rule_jsp.java from :82)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:476)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:366)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:538)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:478)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)

I have proper struts.xml and action defined. Same is working if I am not using ajax.Can some one please help me out here.

Sourabh
  • 680
  • 3
  • 8
  • 18

1 Answers1

0

If you're just starting, I'd advise you not to use Dojo. That ajax plugin is deprecated and no longer maintained.

Try Jquery (there's even a struts-jquery plugin) which is very easy to learn, actively maintained and has loads of plugins so you don't have to reinvent the wheel.

mmalmeida
  • 1,037
  • 9
  • 27