1

In my project i have requirement to open a jsp page as a popup from another jsp for that i use the javascript code as follows

window.open('popup.jsp','popupname','//properties of popup window ')

here in url if i mention as of above then i have to keep that jsp page in webcontent folder

now my question is If i want to keep that jsp page in WEB-INF folder how i have to mention the url.

I tried to give url like WEB-INF/popup.jsp but it is not working. but if i create a new folder in webcontent and try to acess it like createdfolder/popup.jsp its working.

Can anyo one help me one this issue how i have the url to acess the jsp page in WEB-INF.

Note:-I am using springs frame work in my project.

4

1 回答 1

2

您必须使用viewResolver才能找到jsp pages里面的内容WEB-INF

<bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix">
            <value>/WEB-INF/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>

将此添加到您的控制器中

@RequestMapping("/popup.htm")
    public String showPopupPage(){
        return "popup";
    }

在你的jsp页面中添加这个

window.open('popup.htm','popupname','//properties of popup window ')
于 2012-04-15T10:10:14.120 回答