|
HeadTag
The "head" tag renders required JavaScript code and necessary css styles.
Phase-Implementation IntroductionThe "head" tag renders required JavaScript code to configure jQuery and is required in order to use any of the tags included in the jQuery plugin. SamplesHead tag for base AJAX calls<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head/>
</head>
<body>
</body>
</html>Head tag for AJAX calls, Effects and Widgets with Default IndicatorThe "locale" attribute configures jQuery locale for datepicker. Default is "en" you can use all locales that are bundled with jQuery. e.g. "de, "fr", "ja", ... The default indicator is visible at every ajax request. <%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head locale="de" jqueryui="true" defaultIndicator="myDefaultIndicator"/>
</head>
<body>
<img id="myDefaultIndicator" src="images/ajax-loader.gif" alt="Loading..." style="display:none"/>
</body>
</html>ThemesBase ThemesBuilt in themes from Plugin
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head locale="de" jqueryui="true" jquerytheme="redmond"/>
</head>
<body>
</body>
</html>Custome ThemesCreate and Download your own Theme with jQuery ThemeRoller
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<s:url id="context" value="/" />
<sj:head locale="de" jqueryui="true" jquerytheme="mytheme" customBasepath="%{context}template/themes"/>
</head>
<body>
</body>
</html>Attributes
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
► Sign in to add a comment
hi can i get a better example of using a custom theme specially one where there is a namespace with it. it would really help so much thanks
hi i figure it out to remove the namespace change customBasepath="template/themes" to customBasepath="/project name/template/themes"
i have made loadFromGoogle = true in head tag. All files are being downloaded from Google CDN except the file jquery.struts2.min.js. Any Idea wht it is happening?
jquery.struts2.min.js is not hosted at google so it loads from your webapp.
Hi I have a problem with autocompletor.
thanks in advance to all those deligates who even read my comments..
I want to load the contents from Google CDN but in case the internet is down, i want to load the files from local repository. How can I achieve this using sj:head
When I looked at birebug I see http://localhost:8282/struts/js/plugins/jquery.form.min.js With response headers Server Apache-Coyote/1.1 Pragma no-cache Cache-Control no-cache Expires -1 Content-Type text/javascript;charset=UTF-8 Content-Language en-US Transfer-Encoding chunked Date Wed, 18 May 2011 12:28:23 GMT
This means its not getting cached. I have added CachingFilter? for .js but still it not showing me 304 HTTP status its still showing 200 OK ... how can I fix this ?
Hi what about jquery mobile's Custome Themes..?
when i use many struts tags, there are one problem, j-query lib was load many time. How can i fix it ?
We are having a weird issue. We are using the datepicker on a JSP page and we have configured the sj:head correctly as below: <head>
</head> The usage of datepicker is as follows: <sj:datepicker name="dateOfBirth" displayFormat="mm/dd/yy" id="datepicker1" yearRange="-100:-16" buttonImageOnly="true" changeYear="true" changeMonth="true" maxDate="-16y" minDate="-100y" size="10"/> The datepicker worked fine on our Dev servers and also in Production Servers. But 3 days after going live, suddenly there is a random JS loading issue. When the page loads, the datepicker image does not show up (and does not work) and there are Javascript error in JS console. Checked through firebug. On investigating, found that the root cause of the Javascript error is that the file jquery-1.5.2.min.js is not fully loaded. we found this by checking the source of this script by invoking https://<Ourwebsite Name>/struts/js/base/jquery-1.5.2.min.js But this happens very randomly. Some requests to this page will work fine. For some other requests, the datepicker breaks. Even for a same user, Sometimes doing a <Ctrl+F5> randomly toggles the behaviour.
Hi when i put sj:head tag in my jsp the others jquery libraries dont work anymore... what can i do?