porting spring/hibernate app to jython/django

View: New views
4 Messages — Rating Filter:   Alert me  

porting spring/hibernate app to jython/django

by Aljosa Mohorovic-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i have a spring/hibernate based webapp that i would like to try to
port to jython/django.
first thing i would like to do is add jython to this app and create
new page using django templates and forms (without database) just to
check if it works.
i don't have enough time to port entire app (mostly because it's
deployed on ibm websphere and db2 and there is no driver/docs for db2)
so could you provide some tips howto get started only with templates
and forms?

is it possible to combine parts of jython/django to integrate with
existing java apps, in this case spring/hibernate?

Aljosa Mohorovic

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: porting spring/hibernate app to jython/django

by Leo Soto M. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jun 8, 2009 at 6:11 AM, Aljosa
Mohorovic<aljosa.mohorovic@...> wrote:

> i have a spring/hibernate based webapp that i would like to try to
> port to jython/django.
> first thing i would like to do is add jython to this app and create
> new page using django templates and forms (without database) just to
> check if it works.
> i don't have enough time to port entire app (mostly because it's
> deployed on ibm websphere and db2 and there is no driver/docs for db2)
> so could you provide some tips howto get started only with templates
> and forms?
>
> is it possible to combine parts of jython/django to integrate with
> existing java apps, in this case spring/hibernate?

Sure!

You can, for example, use Django's views/templates/urls.py (and
perhaps forms and the others rendering-related helpers) while still
using hibernate as the ORM.

You will loose stuff which depends on Django's ORM like the Admin and
Auth (and perhaps Sessions). There are ways to workaround the problem,
but I don't know if this is relevant in your use case. I suspect you
just want a simpler way for your app to interact with HTTP and the
browser and Django is a good solution for that.

--
Leo Soto M.
http://blog.leosoto.com

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: porting spring/hibernate app to jython/django

by Aljosa Mohorovic-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Jun 13, 2009 at 9:03 PM, Leo Soto M.<leo.soto@...> wrote:
>> is it possible to combine parts of jython/django to integrate with
>> existing java apps, in this case spring/hibernate?
>
> Sure!
>
> You can, for example, use Django's views/templates/urls.py (and
> perhaps forms and the others rendering-related helpers) while still
> using hibernate as the ORM.

i guess the best entry point is replacing spring url handler with
django urls but i don't know how to start.
any docs you could recommend or some source code where i can figure
out how to start?

> You will loose stuff which depends on Django's ORM like the Admin and
> Auth (and perhaps Sessions). There are ways to workaround the problem,
> but I don't know if this is relevant in your use case. I suspect you
> just want a simpler way for your app to interact with HTTP and the
> browser and Django is a good solution for that.

plan is to completely replace spring/hibernate with django (there was
some talk that ibm will open source django DB2 support) but i would
like to be realistic and not rush in.

Aljosa Mohorovic

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: porting spring/hibernate app to jython/django

by Leo Soto M. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Jun 14, 2009 at 8:43 PM, Aljosa
Mohorovic<aljosa.mohorovic@...> wrote:

> On Sat, Jun 13, 2009 at 9:03 PM, Leo Soto M.<leo.soto@...> wrote:
>>> is it possible to combine parts of jython/django to integrate with
>>> existing java apps, in this case spring/hibernate?
>>
>> Sure!
>>
>> You can, for example, use Django's views/templates/urls.py (and
>> perhaps forms and the others rendering-related helpers) while still
>> using hibernate as the ORM.
>
> i guess the best entry point is replacing spring url handler with
> django urls but i don't know how to start.
> any docs you could recommend or some source code where i can figure
> out how to start?

Take a look at the web.xml generated by jython manage.py war. It
"mounts" the Django app on "/" (via the ModJy servlet and the
application.py shipped on the WAR file). If that doesn't work for your
use case, you can modify it so Django is mounted on a different path
and then you can share Spring-mapped URLs and Django-mapped URLs on
the same web application.

Regards,
--
Leo Soto M.
http://blog.leosoto.com

------------------------------------------------------------------------------
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users