Changes between Initial Version and Version 1 of WebInGnowsis


Ignore:
Timestamp:
07/25/06 12:20:54 (18 years ago)
Author:
sauermann
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebInGnowsis

    v1 v1  
     1[[TracNav]] 
     2 
     3[[PageOutline]] 
     4= HTML pages and servlets in gnowsis = 
     5You can server HTML user interfaces and servlets using a normal web-application container. Gnowsis supports ___Servlet 2.3 specification___ using a Jetty server 4.2.22. This is equivalent to a Tomcat 4.1 server. 
     6 
     7If you look into the GnowsisProjectStructure you will notice where the web-pages and the other web-container related information lies: in the {{{service/projectname/}}} folder. You find there the typical elements of a web-application: 
     8* WEB-INF - metadata 
     9** lib - libraries 
     10** classes - the compiled servlets and the compiled gnowsis code 
     11** web.xml - config 
     12 
     13To add new HTML pages, put them into these folders or create a new project with similar folders: 
     14* yourproject/services/yourproject/ 
     15 
     16 
     17= JSP Java Server Pages in Gnowsis = 
     18 
     19how to program java server pages and why stuff doesn't work as usual. 
     20 
     21'''Why is JSP such a thing in gnowsis?''' Because we use special classloaders that kickstart the system. Our classloader lets all classes from all services see each other. Some expected default behaviour is not supported now. 
     22 
     23== How to make JSP and Taglibs run in my Service? == 
     24Look at gnowis-server, in the services/gnowsis-server/WEB-INF path you will see how the hack works: 
     25 
     26 * you extract the taglib-descriptors (for example, in standard jar's, they are in the jar/MANIFEST directory). copy the needed .tld into the web-inf 
     27 * you write the tld's into your web.xml file. see again in gnowsis-server how this is done 
     28 * you insert the taglib-include into your jsp as normal. 
     29 
     30'''How we did it in web.xml''' 
     31{{{ 
     32 ... 
     33 </welcome-file-list> 
     34 
     35<!-- Common JSP Core Tag Library --> 
     36  <taglib> 
     37    <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri> 
     38    <taglib-location>/WEB-INF/c.tld</taglib-location> 
     39  </taglib> 
     40  <taglib> 
     41    <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri> 
     42    <taglib-location>/WEB-INF/fmt.tld</taglib-location> 
     43  </taglib> 
     44  <taglib> 
     45    <taglib-uri>http://java.sun.com/jsp/jstl/xml</taglib-uri> 
     46    <taglib-location>/WEB-INF/x.tld</taglib-location> 
     47  </taglib> 
     48}}} 
     49 
     50 
     51If you know a better way to do it in gnowsis, please tell us via the mailinglist. 
     52 
     53== How does gnowsis get JSP to run? == 
     54 * The java compiler (javacc) in tools.jar is part of the '''gnowsis''' project 
     55 * The jsp compiler (jasper) and runtime are in the gnowsis-server/service/gnowsis-server/WEB-INF/lib path 
     56 * all classloaders inside the services (gnowsis-server, kaukolu, enquire2006, etc) share the same classloader - the '''EPOSWorkspaceClassloader''', so they can load each other. Additionally they have access to the 'gnowsis' classloader, which is the standard java classloader. 
     57 
     58How can I break this? 
     59 * if you move the javacc into the gnowsis-server, it breaks it doesn't find javacc (unknonw why) 
     60 * if you move jasper-compiler to gnowsis, it breaks because the compiler is then loaded with the default classloader and not our EPOSWorkspaceClassloader. so leave it inside gnowsis-server 
     61 * somehow our classloader doesn't interpret the MANIFEST things correctly, so the JSP taglibs in standard.jar are not found and cannot be used with above hack. So don't delete the taglib information from gnowsis-server/WEB-INF.