This is good content for some click documentation, thanks Adrian. regards Malcolm Edgar
On Tue, Jun 30, 2009 at 5:28 PM, Adrian A.<[email protected]> wrote: >> I cannot get Click to work with JSP pages. I wanted to include a JSP page >> in >> my Click app. Reason: We have a legacy code base heavily using JSP/Struts. >> How about JSF pages? Can we include it in a Click app? >> >> This thing is holding us back to use Click as all our existing codes are >> using JSP/JSF/Facelets. Bottom line is I have to be able to include >> existing >> JSP pages if we wanted to use Click. >> >> Any suggestions or tutorials ? I read all I can find, and I know Click can >> work with JSP, but my question is how can I make .htm including JSP pages. >> Any tags like <ui:include>? > > As Bob suggested you can use with Click JSPs too, without problems (in fact > JSPs should be "first class citizens" like Velocity files - those with the > *.htm extension). > > In the case of JSPs however there's a fine distinction: > #1 "JSP Pages" - full blown Click Pages (backed by Java files - using the > automapping feature - or the manual mapping in click.xml), so similar to > e.g. /admin/customer-edit.htm described over the entire documentation (but > in your case it will be /admin/customer-edit.jsp) > #2 "JSP Files" - ordinary JSP files that have for Click no meaning - these > can be your legacy code that you can include or forward or redirect to, > until you are able to completely migrate to Click. > To have such "JSP files", you need to exclude them from the Click mapping. > See "2.3.2 Automapping Excludes" paragraph from: > http://incubator.apache.org/click/docs/configuration.html > > So you need to copy your legacy code in a Click webapplication, and exclude > it from the automapping e.g. if you place all your legacy JSPs in /legacy/*, > than in click.xml you would have: > --------------------- > <click-app> > <pages package="com.mycorp.page"> > <excludes pattern="/legacy/*"/> > </pages> > </click-app> > ---------------------- > Now in your border-template.jsp, or any Click "JSP Page" (e.g. > /adminm/customer-edit.jsp), you can include those legacy jsp file > without problems, e.g. > <jsp:include page="/legacy/footer.jsp" flush="true" /> > > > Adrian. > >
