- This topic has 3 replies, 2 voices, and was last updated 20 years, 3 months ago by jeremiah.
-
AuthorPosts
-
jeremiahMemberI currently have a very large project that uses numerous include statements. Like Connection.jsp which setes up the dn connection for each page. It is there for included in each page. Or in most cases it is included in a section page with defines a set of common functionality for a group of pages. Each of these pages includes it’s section page, whcih includes a connection page or whatever. The problem that I’m having is that the jsp editor shows an error on the actul pages, because I don’t have an import statement for java.sql (generally). In other cases the whole page is ‘broken’ because as a stand alone page, it is not valid, but when included with other pages it’s fine. I’m getting code reuse just fine, but because I’m not fitting in with the JSP editor, I get the feeling that there must be a better way. Aw ay the fits with the MyEclipse way of thinking or JSPs in general.
thanx for any thought or suggestions,
-jj-
Scott AndersonParticipantjj,
There are a couple of options here. Typically, JSP pages that aren’t valid stand-alone (JSP fragments) are given a different suffix than .jsp. The JSP spec recommends the use of .jspf, but really any extension is ok. The validator only runs automatically on files with a .jsp suffix, since they’re supposed to be top-level pages. So, option one is to change the suffix of all your included pages to .jspf, or whatever, and then re-validate your project.
Option 2 is to override the validation settings for the project and turn off automatic JSP validation. You can then use the context menu in the Package Explorer to manually validate only those files you have highlighted, when you want to.
jeremiahMemberThis will keep the fragments from showing up as erroneous, but not the chidlren who upon validation claim that they don’t know about an included Object that came from a frgament.
jeremiahMemberTo put it another way, is jspf the recomended way of doing things, or is it worthwhile to refactor into taglibs and beans and things or JSF. Currently it can sometimes be a little difficult to track down which fragment an error occured in.
-
AuthorPosts