Page 1 of 2 12 LastLast
Results 1 to 10 of 11

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

  1. #1
    Join Date
    Jan 2010
    Posts
    13

    Default 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. #2
    Join Date
    Jun 2009
    Posts
    190

    Default

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

    -Hetal

  3. #3
    Join Date
    Jan 2010
    Posts
    13

    Default

    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?
    Attached Images Attached Images

  4. #4
    Join Date
    Jun 2009
    Posts
    190

    Default

    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

  5. #5
    Join Date
    Jan 2010
    Posts
    13

    Default

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

  6. #6
    Join Date
    Jan 2010
    Posts
    13

    Default

    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?

  7. #7
    Join Date
    Jun 2009
    Posts
    190

    Default

    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

  8. #8
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  9. #9
    Join Date
    Jan 2010
    Posts
    15

    Default 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

  10. #10
    Join Date
    Oct 2008
    Posts
    286

    Default

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

    thanks

    Quote 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.
    Eros

    Environment:
    JSP 2.0
    Dojo 1.4.1
    Ext JS 3.1 (testing)
    Spring MVC 2.5.6.SEC01 (planning to Spring 3 using STS)
    STS
    SWF 2.0.9.RELEASE
    Tiles 2.0.5
    iBatis: ibatis-sqlmap-2.3.4.726

Posting Permissions

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