facebook

problem with jsp in locating external javascript file

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #285574 Reply

    garva21
    Member

    Hello all,
    m developing an application is struts1.1 with myeclipse6.0 IDE(trial version). created a web project and added struts capabilities.now as soon as i login to the application i see admin.jsp page. In this admin.jsp i’ve two external javascript file one for generating jasper reports and for calendar pop-up function.Now the problem m facing is, on the first load of Admin.jsp my javascript file for generating reports works fine but its not looking the file for pop-up calendar.now if i go to other links from admin.jsp and come back again to admin.jsp thn javascript for calendar pop-up works fine but reports generation is giving error………so it seems the path of javascript files is somehow correct coz on two different ocassions thy seems to work individually……….but why my admin.jsp is not looking both the javascript files simultaneously??????is it some path problem while configuring the project…m very new to this eclispe or something else i’m missing??????? actually if u see below the way i’ve included javascript its ambiguous…….my project is not looking the scripts in specific path fashion………..even if i try to fire action through javascript, it is unable to look the action specific method and gives error……plz help me in letting knw what cud be wrong?????

    here is my WebRoot architecture:-

    jsp is under Web->jsp->admin.jsp
    script for reports generation is Web->jsp->scripts->generatereports.js
    script for calendar popup is Web->jsp->scripts->calendar->CalendarPopup.js

    here is how i included those jsp’s in admin.jsp :-
    ………
    <script language=”javascript” src=”scripts/calendar/CalendarPopup.js”></script>
    <script language=”javascript” src=”jsp/scripts/generatereports.js”></script>

    <html:form action=”/abc.do”>………..

    #285583

    Loyal Water
    Member

    garva21,
    If you put both the js files in you under Web folder directly and edit the src paths to look like this, does it work?
    <script language=”javascript” src=”CalendarPopup.js”></script>
    <script language=”javascript” src=”generatereports.js”></script>

    #285621

    garva21
    Member

    Thanx for response nipun……..i tried the way u said above and whn the page first loads after loggin in both the scripts is working fine with an exception, the image icon is not getting displayed…….however whn i come back to the admin page after doin other operations, both the scripts are not visible to jsp………nither the calendar nor the report generation file is being looked by jsp………i see the javascript error as “object not found” for the respective functions in javascript file……..

    #285649

    garva21
    Member

    m still standing where i started……can anyone plz tell me how to sovle the above problem…………why my application is not looking for javascript path properly…………plz let me knw if any details is required for solution???????

    #285650

    garva21
    Member

    m still standing where i started……can anyone plz tell me how to sovle the above problem…………why my application is not looking for javascript path properly…………plz let me knw if more details is required for the solution???????

    #285658

    Loyal Water
    Member

    Can you create a test project and pm it to me so that I can test this at my end. You can hit the pm button at the bottom of my post and send me the project.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: problem with jsp in locating external javascript file

You must be logged in to post in the forum log in