Hi All,
I'm getting below error message for this acrion(http://localhost:7001/hibernate/events/Dojo.action).
dojo is not defined
dojo.require("dijit.form.Button");
Please find my progrm:
<head>
<s:head theme="ajax" debug="true"/>
<title>TooltipDialog demo</title>
<script type="text/javascript">
// Dojo configuration
djConfig = {
parseOnLoad: true,
baseRelativePath: "<@s.url includeParams='none' value='/struts/dojo' includeParams='none' encode='false'/>",
isDebug: true,
bindEncoding: "${parameters.encoding}",
debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
};
</script>
<script type="text/javascript"
src="<@s.url includeParams='none' value='/pages/dojoroot/dojo/dojo.js' includeParams='none' encode='false'/>">
</script>
<link href="<s:url value='/pages/dojoroot/dojo/resources/dojo.css'/>" rel='stylesheet' type='text/css' />
<link href="<s:url value='/pages/dojoroot/dijit/themes/tundra/tundra.css'/>" rel='stylesheet' type='text/css' />
<script type="text/javascript">
dojo.require("dijit.Dialog");
dojo.require("dijit.form.Button");
</script>
</head>
<body class="tundra">
<button dojoType="dijit.form.Button" id="helloButton">
Hello World
<script type="dojo/method" event="onClick">
console.log('you pressed the button');
alert("You pressed the button.");
</script>
</button>
</body>
<s:head theme="ajax" debug="true"/>
<title>TooltipDialog demo</title>
<script type="text/javascript">
// Dojo configuration
djConfig = {
parseOnLoad: true,
baseRelativePath: "<@s.url includeParams='none' value='/struts/dojo' includeParams='none' encode='false'/>",
isDebug: true,
bindEncoding: "${parameters.encoding}",
debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
};
</script>
<script type="text/javascript"
src="<@s.url includeParams='none' value='/pages/dojoroot/dojo/dojo.js' includeParams='none' encode='false'/>">
</script>
<link href="<s:url value='/pages/dojoroot/dojo/resources/dojo.css'/>" rel='stylesheet' type='text/css' />
<link href="<s:url value='/pages/dojoroot/dijit/themes/tundra/tundra.css'/>" rel='stylesheet' type='text/css' />
<script type="text/javascript">
dojo.require("dijit.Dialog");
dojo.require("dijit.form.Button");
</script>
</head>
<body class="tundra">
<button dojoType="dijit.form.Button" id="helloButton">
Hello World
<script type="dojo/method" event="onClick">
console.log('you pressed the button');
alert("You pressed the button.");
</script>
</button>
</body>
In struts.xml, I configured this program as below(forum page submission is removing special characters '<' so I removed those)
action name="Dojo"
result/pages/test1.jsp /result
/action
dojoroot directory is in WEB-INF/pages directory.
Please let me know what is wrong in this code and how to correct this problem.
Thanks in advance.
Regards,
Sharath.

I don't really know anything
I don't really know anything about struts to solve your problem, but the error message you are getting from the js console is what happens when dojo isn't loaded/included. I would try to verify that the path your browser is getting for that second script tag really returns dojo.js.
Dustin