Hi Jason,

not sure it it applicable for you, but I prefer to use embedded jetty for
my JWt developments. It seems to be a simpler approach for non-specialists
in Java like us.
I've used it with JRuby, Groovy (and Clojure some time ago). Below, you'll
find a simple groovy script that uses embedded jetty.

Hope this helps

Raph



import javax.servlet.http.HttpServlet
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.server.Request
import org.eclipse.jetty.servlet.ServletContextHandler
import org.eclipse.jetty.webapp.WebAppContext
import org.eclipse.jetty.server.handler.HandlerList
import org.eclipse.jetty.server.Handler

import org.eclipse.jetty.servlet.ServletHolder

import eu.webtoolkit.jwt.WApplication
import eu.webtoolkit.jwt.WEnvironment
import eu.webtoolkit.jwt.WtServlet
import eu.webtoolkit.jwt.ServletInit
import eu.webtoolkit.jwt.WText
import eu.webtoolkit.jwt.WLineEdit
import eu.webtoolkit.jwt.WPushButton
import eu.webtoolkit.jwt.Side

import eu.webtoolkit.jwt.WFileResource
import eu.webtoolkit.jwt.WImage
import eu.webtoolkit.jwt.WContainerWidget
import eu.webtoolkit.jwt.WHBoxLayout
import eu.webtoolkit.jwt.WVBoxLayout
import eu.webtoolkit.jwt.AlignmentFlag
import eu.webtoolkit.jwt.WSelectionBox
import eu.webtoolkit.jwt.Signal1
import eu.webtoolkit.jwt.Signal2
import eu.webtoolkit.jwt.WNavigationBar
import eu.webtoolkit.jwt.WStackedWidget
import eu.webtoolkit.jwt.WMenu

class HelloApplication extends WApplication {
  def HelloApplication(env) {
    super(env)
    setCssTheme('bootstrap')

    setTitle("Charts");

    def page_layout = new WVBoxLayout()
    def container = new WContainerWidget(getRoot())

    def nameEdit = new WLineEdit()
    nameEdit.keyPressed().addListener(this, { println
it.getKey().toString() } as Signal1.Listener )
    page_layout.addWidget(nameEdit)

    container.setLayout(page_layout)

  }
}

class HelloMain extends WtServlet {
  WApplication createApplication(WEnvironment env) {
    new HelloApplication(env)
  }
}
    server = new Server(8080)

static_content=server.getClass().getClassLoader().getResource("eu/webtoolkit/jwt/wt-resources").toExternalForm()
    web_context=new WebAppContext(static_content, '/wt-resources')

    context = new ServletContextHandler(ServletContextHandler.SESSIONS)
    context.addEventListener(new ServletInit());
    servlet = new HelloMain()
    holder = new ServletHolder(servlet)
    context.addServlet(holder, '/')

    handler_list= new HandlerList()
    Handler[] handlers = [web_context,context]
    handler_list.setHandlers(handlers)
    server.setHandler(handler_list);
    server.start()





On Tue, Sep 24, 2013 at 11:32 PM, Jason H <scorp...@yahoo.com> wrote:

> Wasn't there also a command to create an app skeleton including WEB-INF
> and other dirs?
>
>
>
>   ------------------------------
>  *From:* Jason H <scorp...@yahoo.com>
> *To:* "witty-interest@lists.sourceforge.net" <
> witty-interest@lists.sourceforge.net>
> *Sent:* Tuesday, September 24, 2013 4:46 PM
> *Subject:* [Wt-interest] Many Jython + JWt questions
>
> I am not a Java developer, but I am in a Java shop, so I have to use
> Java-based technologies. I am allowed to use Python. I've asked about PWt,
> but it's apparently not ready yet. The blog post (
> http://www.nan-tic.com/en/from-pyqt-to-jythonjwt-setting-up-the-environment)
>  goes into detail, but not enough detail for me. I'm new to java, tomcat
> and all that.
>
> Problems:
> 1. I installed tomcat7 on windows. There doesn't seem to be a
> tomcat7-instance-create command. How do I setup a webapp?
> 2. What environment do I need set up? Do I need ant?
> 3. How do I write and test the python program? Assuming I edit files, What
> commands are needed to run it?
>
> Many thanks.
>
>
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>


-- 
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to