views:

31

answers:

3

Hi all I have problem including jsp pages. I have one JSP page where I must have not closed tags because in including page I continue filling them and close them. Page beeing included

<div class="ui-layout-content">
<form id="kartaForm">

    <%-- zalozka Budova --%>

    <m:zalozka id="tabs-1">
        <m:sloupec prvni="true">

            <elem:id/>
            <elem:string path="typSubjektu" styl="I" />
            <elem:boolean path="fyzickaOsobaPodnikatel"/>
            <elem:string path="kod" styl="P" />

Page that include this page: This is statement that includes page

<%@ include file="/jsp/Subjekt/Subjekt/SubjektFormularNew.jsp" %>

and here is the rest of the page

            </m:sloupec>

            <m:sloupec />
        </m:zalozka>
    </form>
    </div>
</div>

so finally all tag are closed. And as I read documentation include directive just puts text into jsp page and then it is translated into servlet but in my case I get exception that tags are not closed. Any idea how to solve this?


Update:

I am using JSP and OracleJDeveloper as IDE and spring and here is the stacktrace

org.apache.jasper.JasperException: /jsp/Subjekt/PravnickaOsoba/PravnickaOsobaFormularNew.jsp(1,1) /jsp/Subjekt/Subjekt/SubjektFormularNew.jsp(48,16) Unterminated &lt;m:sloupec tag
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
    org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:345)
    org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:378)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:486)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
    org.apache.jasper.compiler.Parser.parse(Parser.java:138)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:240)
    org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:258)
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1174)
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:901)
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)
    org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
    org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
    org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:271)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
    org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
    org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)
    org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
A: 

Try <jsp:include page="/jsp/Subjekt/Subjekt/SubjektFormularNew.jsp"/> it has some benefits against include

Dewfy
I tried but I got the same result as with directive
Peter
A: 

(moved into question, please do not post questions/updates as answers, you should delete this "answer")

Peter
A: 

JSP tags are made for these kind of scenarios. Change your jsp to a tag. If you are using container supporting jsp 2.0, you can use .tag files too. If you want to just use like this try using jsp:include

Teja Kantamneni
Thanks I will try to make .tag file and hope it will help
Peter
I changed jsp to tag but I get the same exception as before
Peter
so you created a new `tag` with opening and closing in same file and a property/attribute which will be rendered in place of your include, right? what is the error you are getting if that is the case
Teja Kantamneni