aspose file tools*
The moose likes JSP and the fly likes including a file in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "including a file in jsp" Watch "including a file in jsp" New topic
Author

including a file in jsp

Muhammad Imad Qureshi
Ranch Hand

Joined: Sep 13, 2005
Posts: 238
I am including a jsp inside one of my jsps as follows

<form method="post">
......some code
<%@ include file="addressFind.jsp" %>
.....some more code
</form>

now in my javascript function when I say document.forms[0].element then it gets the form from addressFind.jsp and not the current form. and when i say document.forms[1].element then it says forms[1] has no properties. How can I include the file and still be able to access my current form. This page is a popup page.
Thanks
Imad
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

If you are including a form within another form then you are generating invalid HTML. It has nothing to do with the include -- the same thing would happen if you didn't use the include and generated an HTML file with a form within a form.

Remember, JSP is just a templating technology to generate the HTML page to send to the browser. It's your repsonsibility to ensure that the HTML that gets generated is valid.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: including a file in jsp
 
Similar Threads
save a form after adding options to it...
problem with commons FileUpload
Sharing a scripting variable across JSPs
Problem in window.close; page get requested again
JSP-EXCEL save defualt in .xls extension, open excel with in the browser