Need Help on jQuery and Struts2
Hello ,
I am working with Struts2 and jQuery.
But I am able to add the Jquery datePicker widget with My Project.
and Code Snap shot and Structure of the Wen-Content is as Follow :
Directory Sructure for the Project is as Follows :
Web-Content
--images //it Contains Required Images.
--js //contins js of jquery.
----jquery-1.4.2.min.js
----jquery-ui-1.8.custom.min.js
--META-INF
--theme
----... //Contins jquery control ui css.
--ui
----jquery.ui.core.js
----jquery.ui.datepicker.js
----jquery.ui.widget.js
--WEB-INF
----classes
-------... //contains required action classes .class and validation.xml
-------srtuts.xml
----LIB // Contains required libraries by Struts2 Framework
----SRC // Source code for Class Files .java files
----web.xmml
--index.jsp
--other jsp pages are here
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="sx" uri="/struts-dojo-tags" %>
<html>
<head>
<sx:head/>
<meta charset="UTF-8" />
<title>jQuery UI Tabs - Default functionality</title>
<link type="text/css" href="theme/jquery.ui.all.css" rel="stylesheet" />
<link type="text/css" href="theme/jquery-ui-1.8.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<SCRIPT type="text/javascript" src="js/jquery-ui-1.8.custom.min.js"></SCRIPT>
<script type="text/javascript" src="ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="ui/jquery.ui.datepicker.js"></script>
<script type="text/javascript">
$(function() {
$("#datepicker").datepicker();
});
</script>
</head>
<body>
<s:form action="HelloTest">
<s:textfield name="firstName" label="Enter Your Name Here : " />
<s:submit/>
<!--This Struts2 DOJO Control to Select Date.-->
<s:datetimepicker cssStyle="width:300px;" type="date" iconPath="images/calendar.gif" label="Date" displayFormat="dd/MMM/yyyy"> </s:datetimepicker>
</s:form>
<s:form>
<!--Adding jQyery datetimecotrol Control To text area-->
<s:textfield cssClass="datepicker" > </s:textfield>
</s:form>
</body>
</html>