Results 1 to 10 of 10

Thread: Spring's Web Application and Dojo

Hybrid View

  1. #1

    Question Spring's Web Application and Dojo

    Hello,

    I am trying build web applications using Spring and Dojo, I'm using the "<mvc:resources/>" element in the spring's configuration.

    I have the next problem, when I use "dijit.byId('idelement')" I get an error message:

    1. "dijit.byId is not a function" in Firefox 5.0 with Firebug
    2. "Uncaught TypeError: Object #<Object> has no method 'byId'" in Chrome 12

    My questions are:

    1. Is possible use spring 3 and dojo independently (in a no intrusive way)? that is, use in one application but each with its own syntax.

    2. How I cant solve those error messages?

    3. Does it apply the same settings for Spring MVC 3 and Spring Web Flow 2?

    I hope someone can help me.

    Thanks and regards,

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    Hello

    I have the next problem, when I use "dijit.byId('idelement')" I get an error message:

    1. "dijit.byId is not a function" in Firefox 5.0 with Firebug
    2. "Uncaught TypeError: Object #<Object> has no method 'byId'" in Chrome 12
    Did you tested in other webbrowser?

    Post here your jsp code specially when you are declaring or importing Dojo
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

  3. #3

    Question Code and Project

    Thanks for your answer,

    My jsp code is:

    Code:
    <%@page contentType="text/html" pageEncoding="windows-1252"%>
    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
    <html>
        <head>
            <style type="text/css">
                @import "resources/dojo1.5/dijit/themes/claro/claro.css";
            </style>
            <script type="text/javascript" src="resources/dojo1.5/dojo/dojo.js" djConfig="isDebug:true, parseOnLoad:true"/>
            <script type="text/javascript">
                dojo.require("dijit.form.TextBox");
                dojo.require("dijit.Dialog");
                dojo.require("dijit.layout.ContentPane");
                dojo.require("dijit.form.Button");
                dojo.ready(function(){
                    alert("Dojo version " + dojo.version + " is loaded");
                });
            </script>
            <script type="text/javascript">
                function showDialogTest(){                
                    dijit.byId('dialogContent').show();                
                }
            </script>
        </head>
        <h2>Registrar Datos</h2>
        <body class="claro">        
            <form:form modelAttribute="data">
              <input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}">
              <b>Campo 1:  </b> <input dojoType="dijit.form.TextBox" type="text" name="campo1" path="campo1" /><br/>
              <b>Campo 2:  </b> <input dojoType="dijit.form.TextBox" type="text" name="campo2" path="campo2" /><br/>          
              <input dojoType="dijit.form.Button" type="submit" class="button" name="_eventId_submit" value="Submit">
              <input dojoType="dijit.form.Button" type="button" value="mostrar" onclick="showDialogTest()">
            </form:form>
            <div dojoType="dijit.Dialog" id="dialogContent" title="Test ContentPane" style="display: none">
                <div dojoType="dijit.layout.ContentPane">
                </div>
            </div>
        </body>
    </html>
    Also I am attaching the project structure for see the location of dojo.

    Notes:

    1. when request the url 'http://localhost:8181/springwebflowtemplate/resources/dojo1.5/dojo/dojo.js' in the browsers, the resource is loaded succesfully.

    2. The problem occurs to call the 'showDialogTest()' function.

    3. Apparently the cause of problem is that the jsp is loaded but dojo isn't loaded

    Thanks and regards,
    Attached Images Attached Images

  4. #4

    Default

    Hello,

    Anyone can help me with this topic?

    I understand how to work with Spring MVC and Spring Web Flow but for real web applications need a good interface for the users. I want to use dojo because already I've worked with this tool.

    Thanks in advance.

  5. #5

    Default

    Hello,

    I made a basic tests using dojo and with Spring MVC (without using Spring Web Flow) and is working normally (as expected).

    Apparently the problem is when working with spring web flow, so my query is: what considerations should be taken into consideration for the view layer when working with spring web flow?

    I hope someone can help me.

    Thanks and regards,

  6. #6
    Join Date
    Sep 2010
    Location
    Sri Lanka
    Posts
    61

    Thumbs up Friend Solve it like This

    is is not solved yet.?
    following tags enter to your web.xml

    Code:
    	
    	<servlet-name>default</servlet-name>
    		<url-pattern>*.css</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>default</servlet-name>
    		<url-pattern>*.js</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>default</servlet-name>
    		<url-pattern>*.jpg</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>default</servlet-name>
    		<url-pattern>*.jpeg</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>default</servlet-name>
    		<url-pattern>*.gif</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>default</servlet-name>
    		<url-pattern>*.png</url-pattern>
    	</servlet-mapping>

    you know how to load data to dojo grid.?
    if you know please let me explain about it.

    thanks & regards

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •