Announcement Announcement Module
Collapse
No announcement yet.
Using Spring-Dojo libraries stop some html elements getting displayed by the browser Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Spring-Dojo libraries stop some html elements getting displayed by the browser

    Hi Guys,

    I have created a small application using Spring MVC, Tiles and WebFlow. It's a simple MVC application and WebFlow is used only to access java script libraries.

    Problem i am facing is using the java script libraries (Spring.js, Spring-Dojo.js and dojo.js) stops some html getting displayed by the browser.

    If i comment out the java script usage section then all elements gets displayed.

    Versions of spring modules used are as follows.

    Spring Core : 2.5.6
    WEBFLOW - 2.0.8
    Tiles - 2.0.7

    My Home.jsp is attached. <Script> elements specified in the <Head> section prevent "header" getting displayed.

    If i comment <Script> elements "header" is displayed with other contents.



    <?xml version="1.0" encoding="utf-8"?>
    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
    <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <html>
    <head>
    <meta content="text/html" http-equiv="contentType" lang="java"/>
    <title><tiles:getAsString name="title"/></title>
    <link type="text/css" rel="stylesheet" href="../css/mycss.css"/>
    <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js"/>"/>
    <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js"/>"/>
    <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js"/>"/>
    </head>
    <body>

    <div id="wrap">
    <div id="headerArea">
    <tiles:insertAttribute name="header"/>
    </div>
    <div id="contentArea">
    <tiles:insertAttribute name="content"/>
    </div>
    <div id="footerArea">
    <tiles:insertAttribute name="footer"/>
    </div>
    </div>
    </body>
    </html>


    If it's a problem with Browser settings please let me know.

    Any help will be highly appreciated.

  • #2
    Try using Firefox tools to debug if the js file s etc are being loaded. Firefox may help you to trace the issue.

    -Hetal

    Comment


    • #3
      Thanks for the Info.

      Looks like only the first script out of 3 is loaded by the browser.

      Screen images of "source" and "firebug" are attached.

      I tried changing the order of the .js files specified, still results are the same.

      any thoughts?

      Comment


      • #4
        I am not able to open these at my end but i am sure there is an error console telling you the reason why the load did not happen.

        -Hetal

        Comment


        • #5
          Checked the Error Console.
          There is only one warning.
          Unknown property 'zoom'.Declaration dropped.

          Comment


          • #6
            Not sure what was the problem.
            I put a closing tag for the <Script> element, then it started working.

            Updated <head> element is as follows.

            <head>
            <title><tiles:getAsString name="title"/></title>
            <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js"/>"></script>
            <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js"/>"></script>
            <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js"/>"></script>
            <link type="text/css" rel="stylesheet" href="../css/mycss.css"/>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            </head>


            as you could see only difference is all <script> elements has a corresponding closing element.

            Would like to know why this error got generated in first place (why only one first library is loaded)? and with the changes i have done
            How come all the libraries are getting loaded?

            Comment


            • #7
              Try maintaining the order as :-
              <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />"> </script> <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"> </script> <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"> </script>

              We had faced a similar issue while using prototype.js along with dojo.js

              -Hetal

              Comment


              • #8
                Would like to know why this error got generated in first place (why only one first library is loaded)? and with the changes i have done
                How come all the libraries are getting loaded?
                The script tags needs a full closing tag, you cannot use an inline / to close the tag. If you do you will get invalid html and depending on the browser it might or might not render.

                Comment


                • #9
                  Spring Dojo

                  I had a question related to ValidateAllDecoration.If a required field is empty, it prevents the form from submitting.However is there a way to capture the error and show the user the name of the field which needs to be entered in order to successfully post the form.Right now i use

                  Spring.addDecoration(new Spring.ValidateAllDecoration({
                  elementId : 'next',
                  event:'onclick'
                  }));

                  Any inputs will be appreciated

                  Comment


                  • #10
                    could you attach the whole project Sir? in order to see what's really going on..

                    thanks

                    Originally posted by shijuppaul View Post
                    Hi Guys,

                    I have created a small application using Spring MVC, Tiles and WebFlow. It's a simple MVC application and WebFlow is used only to access java script libraries.

                    Problem i am facing is using the java script libraries (Spring.js, Spring-Dojo.js and dojo.js) stops some html getting displayed by the browser.

                    If i comment out the java script usage section then all elements gets displayed.

                    Versions of spring modules used are as follows.

                    Spring Core : 2.5.6
                    WEBFLOW - 2.0.8
                    Tiles - 2.0.7

                    My Home.jsp is attached. <Script> elements specified in the <Head> section prevent "header" getting displayed.

                    If i comment <Script> elements "header" is displayed with other contents.



                    <?xml version="1.0" encoding="utf-8"?>
                    <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
                    <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
                    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
                    <html>
                    <head>
                    <meta content="text/html" http-equiv="contentType" lang="java"/>
                    <title><tiles:getAsString name="title"/></title>
                    <link type="text/css" rel="stylesheet" href="../css/mycss.css"/>
                    <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js"/>"/>
                    <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js"/>"/>
                    <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js"/>"/>
                    </head>
                    <body>

                    <div id="wrap">
                    <div id="headerArea">
                    <tiles:insertAttribute name="header"/>
                    </div>
                    <div id="contentArea">
                    <tiles:insertAttribute name="content"/>
                    </div>
                    <div id="footerArea">
                    <tiles:insertAttribute name="footer"/>
                    </div>
                    </div>
                    </body>
                    </html>


                    If it's a problem with Browser settings please let me know.

                    Any help will be highly appreciated.

                    Comment


                    • #11
                      Hi Hetal and all,

                      I have Chinese characters retrieving from database MySQL version 5.x to my form:input decorated with Dojo. The characters turn to be some garbage. It is simply a HTTP GET.

                      The app server is running on tomcat 6.0. What should I have been missing?

                      Is it due to encoding mismatch in Dojo?
                      Is it due to encoding mismatch in JDBC?

                      Tried setting encoding in web.xml and added meta to html and setting URIEncoding in connector in tomcat server.xml. To no avail.

                      BR,
                      Philip

                      Comment

                      Working...
                      X