Hi Juan, On Aug 12, 2010, at 7:18 AM, Antoine Toulme wrote:
> Juan, I work with Jetty, and I heard bad things about JSPs. It seems there > are multiple implementations of the standard. > I see your dependencies contain twice a JSP api jar. I would probably > contact the Jetty project to get the right jar to use (I know Jetty 7 use > javax.jsp 2.1 from glassfish). > > I am wondering if you could use our own jetty addon ? > http://github.com/apache/buildr/blob/trunk/addon/buildr/jetty.rb I use Buildr's Jetty extension with JSPs and it works okay. (If I were starting a new project today, I wouldn't use JSP, but that's a separate issue.) This is how I enable JSP support: Java.classpath.concat([ "org.mortbay.jetty:jsp-api-2.1:jar:#{Buildr::Jetty::VERSION}", "org.mortbay.jetty:jsp-2.1:jar:#{Buildr::Jetty::VERSION}" ]) Buildr::Jetty::VERSION is 6.1.3 in buildr 1.4.1. I agree with Antoine that the duplicate JSP libs are probably a problem. I think it may also be that the classpath is already committed before you invoke Java::Commands.java, though I've never used java with :classpath so I'm not sure how buildr handles it. Rhett > > Thanks, > > Antoine > <http://github.com/apache/buildr/blob/trunk/addon/buildr/jetty.rb> > > 2010/8/11 Juan Carlos Méndez <[email protected]> > >> I'm trying to run jetty using TestServer but the following error is thrown: >> "JSP support not configured" >> >> Any ideas? >> >> This is my config: >> >> JETTY = [ >> 'org.mortbay.jetty:jetty:jar:6.1.25', >> 'org.mortbay.jetty:jetty-util:jar:6.1.25', >> 'org.mortbay.jetty:jsp-2.1-jetty:jar:6.1.25', >> transitive('org.mortbay.jetty:maven-jetty-plugin:jar:6.1.25'), >> 'org.mortbay.jetty:maven-jetty-jspc-plugin:jar:6.1.25', >> 'sun-servlet:jsp-api:jar:2.4', >> 'javax.servlet:jsp-api:jar:2.0', >> 'org.apache.ant:ant:jar:1.8.1', >> 'xerces:xercesImpl:jar:2.9.1', >> ] >> >> >> >> task :run => :compile do >> Java::Commands.java('JettyTestServer',:classpath >> =>compile.dependencies + >> [compile.target.to_s]+package(:war).libs+artifacts(JETTY)) >> end >> >> >> ******** >> import org.mortbay.jetty.Server; >> import org.mortbay.jetty.webapp.WebAppContext; >> import org.slf4j.Logger; >> import org.slf4j.LoggerFactory; >> >> /** >> * >> * @author >> * >> */ >> class JettyTestServer { >> >> private static final Logger log = >> LoggerFactory.getLogger(JettyTestServer.class); >> >> /** >> * >> * @param args >> */ >> public static void main(String[] args){ >> >> try { >> Server server = new Server(9080); >> WebAppContext webAppContext = new >> WebAppContext("src/main/webapp", "/mywebapp"); >> >> String[] configClasses = >> {"org.mortbay.jetty.webapp.WebInfConfiguration", >> "org.mortbay.jetty.webapp.WebXmlConfiguration"}; >> webAppContext.setConfigurationClasses(configClasses); >> server.addHandler(webAppContext); >> server.start(); >> server.join(); >> } catch (Exception e) { >> log.error(e.getMessage(), e); >> } >> >> } >> } >> ********* >> >> >> Juan Carlos >>
