how to jquery .load() from web-inf folder

我的梦境 提交于 2019-12-25 02:08:51

问题


How would the url look if I'm trying to .load() a file in WebContent/WEB-INF/jsp/jsp2.jsp from a file in WebContent/js/jsFile.js

I've tried

"../WEB-INF/jsp/file.jsp"

"/WEB-INF/jsp/file.jsp"

"WEB-INF/jsp/file.jsp"

"/jsp/file.jsp"

"jsp/file.jsp"

Edit:

    $("#Submit").live({
        click: function(){
            $("#listView").fadeOut(1000, function(){
            });
            $("#screenView").load({
                url: "../WEB-INF/jsp/jspFile2.jsp",
                complete: function(){
                    alert("completed");
                }
            });
        }
    });

This is the code I'm using to load from WEB-INF/jsp/jspFile1.jsp.. It's not rendering the jspFile2.jsp in the screenView div as I was expecting..

the div screenView and listView are siblings.

Thanks,

wenn


回答1:


I think the first one you wrote is correct:

 "../WEB-INF/jsp/file.jsp"

if you post more info about the error and your code we could provide a more detailed answer (maybe the problem is different from what you think)




回答2:


../WEB-INF/jsp/file.jsp is correct, you must be having another problem. try redirecting the browser to the file and see if it shows up.



来源:https://stackoverflow.com/questions/6847038/how-to-jquery-load-from-web-inf-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!