aspose file tools*
The moose likes Struts and the fly likes autocompleter and datetimepicker not working in Struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "autocompleter and datetimepicker not working in Struts 2" Watch "autocompleter and datetimepicker not working in Struts 2" New topic
Author

autocompleter and datetimepicker not working in Struts 2

Joshi Avadhut
Greenhorn

Joined: May 13, 2008
Posts: 15
Hi,

autocompleter and datetimepicker not working in Struts 2.

the error given as unknown tag or tag not defined

is this problem is due to some library file. I am using

struts2-core-2.1.6.jar
standard.jar
ognl-2.6.11.jar
jstl.jar
freemarker-2.3.8.jar
commons-logging-1.0.4.jar
commons-fileupload-1.2.1.jar
xwork-2.1.2.jar


Please help.

Thanks & Regards,

Avadhut Joshi

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Did you use the <sx:head> tag?
Joshi Avadhut
Greenhorn

Joined: May 13, 2008
Posts: 15
I used <s:head theme="ajax" />
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Okay, well, that's not how the S2.1 Dojo tags work. Perhaps the documentation would help.
Joshi Avadhut
Greenhorn

Joined: May 13, 2008
Posts: 15
Thanks for this.

As per document I made changes
1. added jar
2. changed the tags

still getting following error

org.apache.jasper.JasperException: File "/struts-dojo-tags" not found

Sorry for bothering. Please help.

Thanks & Regards,

Avadhut Joshi
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Show the code and the S2 filter configuration.
Joshi Avadhut
Greenhorn

Joined: May 13, 2008
Posts: 15
autocompleter.jsp
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ taglib uri="/struts-tags" prefix="s"%>

<html>
<head>
<title>Struts 2 Autocompleter Example!</title>
<sx:head parseContent="true"/>


</head>
<body>
<h1>Struts 2 Auto completer Example!</h1>
<s:label name="stateName" value="Select State Name:" />
<sx:autocompleter list="state" name="StateName"/>
</body>
</html>




<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Are you *sure* the Dojo plugin file is being deployed?
Joshi Avadhut
Greenhorn

Joined: May 13, 2008
Posts: 15
I feel so as I have added it in library and it is showing in it..

is there any other way to check it.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You'd have to check the physical deployment. If the library is there I don't know why it would say the URI wasn't found.

Can you supply any more of the error message? Is there a stack trace?
Joshi Avadhut
Greenhorn

Joined: May 13, 2008
Posts: 15
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: File "/struts-dojo-tags" not found
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:160)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:431)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:494)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
org.apache.jasper.compiler.Parser.parse(Parser.java:138)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:389)


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Still looks to me like the Dojo plugin isn't being deployed.
Joshi Avadhut
Greenhorn

Joined: May 13, 2008
Posts: 15
where should I check physical deployment. please help.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I really have no clue where you're deploying your libraries.
Joshi Avadhut
Greenhorn

Joined: May 13, 2008
Posts: 15
D:\Workspace\strutsAjaxDemo\src\Libraries\
Joshi Avadhut
Greenhorn

Joined: May 13, 2008
Posts: 15
Thanks buddy..its done I got my mistake it was not physically deployed..thanks a lot..I was stick in this for two days like a blind man.. thanks again..
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No problem--if I had a nickel for every time I thought I'd deployed something but hadn't I'd be rich!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: autocompleter and datetimepicker not working in Struts 2