DOJO not working under tomcat 5.x? - struts2

I have a JSP that uses DOJO Datepicker. It runs fine on my laptop where I have Netbeans6.9/tomcat 6.x installed. However, when I upload it to my hosting service, the DOJO Datepicker doesn't show while the rest of the page shows up fine!
My web app is developed using Java Struts2.
I compared the source code between the two environments (local & remote). And I noticed that has no effect on the remote page. Where on the local page it translates to some DOJO configuration.
Remote page:
<head>
<title>Profile</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="MainLayout.css" rel="stylesheet" type="text/css">
</head>
Local Page:
<head>
<title>Contract Profile</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="MainLayout.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript">
// Dojo configuration
djConfig = {
isDebug: false,
bindEncoding: "UTF-8"
,baseRelativePath: "/sm/struts/dojo/"
,baseScriptUri: "/sm/struts/dojo/"
,parseWidgets : false
};
</script>
<script language="JavaScript" type="text/javascript"
src="/sm/struts/dojo/struts_dojo.js"></script>
<script language="JavaScript" type="text/javascript"
src="/sm/struts/ajax/dojoRequire.js"></script>
<link rel="stylesheet" href="/sm/struts/xhtml/styles.css" type="text/css"/>
<script language="JavaScript" src="/sm/struts/utils.js" type="text/javascript"> </script>
<script language="JavaScript" src="/sm/struts/xhtml/validation.js" type="text/javascript"></script>
<script language="JavaScript" src="/sm/struts/css_xhtml/validation.js" type="text/javascript"></script>
</head>
In addition, FireBug, gives me object dojo not defined message on loading the page remotely. These are clear signs that it's not behaving the same.
But the question is what do I do so it does?
Your help is much appreciated as I really getting disperate.

"dojo not defined" means dojo didn't load.
Go to the network tab in firebug and find the full path for dojo.js
http://mydomain.com/contextPath/static/dojo/dojo.js
Chances are this will be in red, meaning that firefox couldn't load the resource.
The problem is probably one of the following:
The dojo files are in a different path. The contextPaths might be different between your development and production environments and you have it hard coded for your development environment.
Your build script that builds the war file did not include the dojo javascript and it is missing entirely on the production environment.

Related

Popupcalendar in Websphere Application Server 9 Tomahawk20

I'm new to stackoverflow so please excuse any error.
I'm getting a PopupCalendar issue in my application using Tomahawk2, JSF 2, WAS9.
I've defined the ExtensionFilter - /faces/myExtensionResource/* and at runtime it should load in source /faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader -> calendar.HtmlCalendarRenderer while it is pointing to javax.faces.resource
The HTML is missing this:
<link rel="stylesheet" href="/DERO_WEB/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/15238805/calendar.HtmlCalendarRenderer/WH/theme.css" type="text/css" />
<link rel="stylesheet" href="/DERO_WEB/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/15238805/calendar.HtmlCalendarRenderer/DB/theme.css" type="text/css" />
<script type="text/javascript" src="/DERO_WEB/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/15238805/prototype.PrototypeResourceLoader/prototype.js"></script>
<script type="text/javascript" src="/DERO_WEB/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/15238805/calendar.HtmlCalendarRenderer/date.js"></script>
<script type="text/javascript" src="/DERO_WEB/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/15238805/calendar.HtmlCalendarRenderer/popcalendar.js">
I have tried setting com.ibm.ws.webcontainer.invokeFiltersCompatibility=true in Web Container in WAS but that has not resolved the issue. I think this parameter setting is not required in WAS 9 but still I went ahead to see if it resolves anything.
Can anyone here help?
'h:head' instead of 'head' did the trick for me and the calendar functionality started working as normal.

How to use open source version of Kendo UI in MVC application

I see Telerik provides open source version of Kendo UI at following URL
http://www.telerik.com/download/kendo-ui-core
I downloaded it but not able to make it work in ASP.NET MVC application.
I am not sure what i am missing. I make a call to CSS and JS files as mentioned in below link:
http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/asp-net-mvc-4
Although I am missing one step Add reference to Kendo.Mvc.dll because Telerik don't provide installer in free version and I need JavaScript version of Kendo UI not with MVC selector.
Any idea here?
If you go to: http://dojo.telerik.com/
The default page contains everything you will need to get up and running and in what order:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled</title>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.default.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.dataviz.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.dataviz.default.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.mobile.all.min.css">
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://cdn.kendostatic.com/2014.2.716/js/kendo.all.min.js"></script>
</head>
<body>
</body>
</html>
If it is still not working after you put this in your page then something else is going on.
Comment out the following line in _layout.cshtml page
##Scripts.Render("~/bundles/jquery")#
and add the below lines at the end of the head section :
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://cdn.kendostatic.com/2014.2.903/js/kendo.all.min.js"></script>

Adding JQuery validation script to header causes the action methods to fire twice

On any MVC sample application , adding #Scripts.Render("~/bundles/jqueryVal") to the header causes the action method on any link to execute twice.
I have put down the sample header for reference. Can some explain why this might happen ?
If I remove the #Scripts.Render("~/bundles/jqueryVal") tag, action methods behave fine.
<head>
<meta charset="utf-8" />
<title>Cool Blogger</title>
<meta name="viewport" content="width=device-width" />
<script type="text/javascript" src="~/Scripts/jquery-1.8.2.min.js" ></script>
<script type="text/javascript" src="~/Scripts/jquery-ui-1.8.24.js" ></script>
<script type="text/javascript" src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
#Styles.Render("~/Content/css")
#Scripts.Render("~/bundles/modernizr")
#Scripts.Render("~/bundles/jquery")
#Scripts.Render("~/bundles/jqueryVal")
</head>
Please have a look and check for double references, look at the developer tools under chrome to see if the script loaded twice, or if you have any error in console mention that the error occurs, you can also see the binding on each element in chrome developer console (F12)

Rails asset pipeline isn't working

It seems that the Rails asset pipeline isn't functioning correctly in my development environment. I'm experiencing the following issues:
Manifest files are being served in addition to other files.
Files are not being concatenated.
Some of the files that are served are completely empty.
These issues apply to both CSS and JavaScript assets. Below is a copy of the HTML output (I haven't edited the default rails layout). Note the presence of the manifest files and all the assets (which should be concatenated into a single file).
<!DOCTYPE html>
<html>
<head>
<title>Jackeyes</title>
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/home.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/universal.css?body=1" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/home.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery.waitforimages.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
<meta content="authenticity_token" name="csrf-param" />
<meta content="0AZh7mNJS7R1jsHKyZ5eKBrAON10Jra2677A8Lg3wzw=" name="csrf-token" />
</head>
<body>
I'm new to Rails, so I'm not sure how to begin resolving this. Any help would be greatly appreciated!
This is the default behaviour for rails in a development environment. I would suggest reading about asset pipeline in the rails guides.
During development, it tends to make things easier to debug if your assets are in separate files. For example, if you're using firebug in Firefox, you can look at each separate javascript file to see your compiled coffee output, set breakpoints, etc. It could also become inefficient to concatenate resources on each request, which tends to be important in a development environment where you're constantly changing assets and loading pages.
If you want to have everything concatenated while in development though, you set config.assets.debug = false in app/config/environments/development.rb.

Problems with Jira gadget configuration screen

I keep running in to strange issues when writing gadgets for Jira. I get problems like the options being clipped out of view, reconfiguration not working and most annoyingly: projectOrFilterPicker not working.
Most of the weird issues I run in to I can work around which is what I've done however I need to allow the user to use that quick search box for selecting a project or a filter. However, as soon as I include one of these dialog boxes the gadget just loads endlessly and if I resize the screen (one of the workarounds I use for other things) I get an error 500.
A weird thing is that it works locally on the Atlassian SDK test Jira (V 4.4) but not on my workplaces full test server (V 2.1.3).
This is some of the code I'm using and I can post more if necessary:
var projectPicker = AJS.gadget.fields.projectOrFilterPicker(gadget, "projectId", args.projectOptions);
args.projectOptions are defined here:
args: function()
{
return [
{
key: "projectOptions",
ajaxOptions: "/rest/gadget/1.0/filtersAndProjects"
}
];
}()
Any insight/suggestions would be greatly appreciated. Thanks in advance.
Carl
I added the following code to the top of the gadget javascript:
<link type="text/css" rel="stylesheet" href="http://iedev255/s/531/4/1.0/_/download/batch/jira.webresources:autocomplete/jira.webresources:autocomplete.css" media="all">
<link type="text/css" rel="stylesheet" href="http://iedev255/s/531/4/4.1.2/_/download/batch/com.atlassian.jira.gadgets:common/com.atlassian.jira.gadgets:common.css" media="all">
<link type="text/css" rel="stylesheet" href="http://iedev255/s/531/4/4.1.2/_/download/resources/com.atlassian.jira.gadgets:common/global.css" media="all">
<script type="text/javascript" src="http://iedev255/s/531/4/2.1.3/_/download/batch/com.atlassian.auiplugin:ajs/com.atlassian.auiplugin:ajs.js" ></script>
<script type="text/javascript" src="http://iedev255/s/531/4/1.0/_/download/batch/jira.webresources:jira-global/jira.webresources:jira-global.js" ></script>
<script type="text/javascript" src="http://iedev255/s/531/4/1.0/_/download/batch/jira.webresources:autocomplete/jira.webresources:autocomplete.js" ></script>
<script type="text/javascript" src="http://iedev255/s/531/4/4.1.2/_/download/batch/com.atlassian.jira.gadgets:common/com.atlassian.jira.gadgets:common.js" ></script>
It solved a lot of my problems

Resources