Hi Keith,

Sorry for the late reply.

What exactly are you trying to reuse ?

I'm just trying to understand. Stripes is supposed to handle the Web MVC
part : if your application's logic is written in its "tier", then it should
not depend on Stripes. Your action beans usually just invoke your biz logic,
that should be written in an independent module.

If you depend directly on CryptoUtils, then your best option is probably to
fork that one single class for your standalone app and re-implement the
methods you use so that they don't call StripesFilter. Using MockRoundtrip
in a standalone app seems odd.

Last, if you have a refactoring proposal for the class (to make the crypto
feature independant of Stripes) that's worth it, we'll surely consider the
option.

Cheers

Remi

2010/11/4 Keith <khyl...@bge.ie>

> Hi,
>
> We have a stripes web application.
>
> We now wish to re-use some of the functionality of the web application in a
> standalone java program without re-writing the code.
>
> The problem we are facing is that the web-application uses the CryptoUtils
> class to encrypt/ decript some values.
>
> When this is run from a standalone program we get the error below.
>
> Is it possible to use the CryptoUtil in standalone mode, perhaps by Mocking
> certain objects, or injecting a Configuration instance.
>
> Cheers,
> Keith
>
> ERROR: net.sourceforge.stripes.controller.StripesFilter -
> net.sourceforge.stripes.exception.StripesRuntimeException: Something is
> trying
> to access the current Stripes configuration but the current request was
> never
> routed through the StripesFilter! As a result the appropriate Configuration
> object cannot be located. Please take a look at the exact URL in your
> browser's address bar and ensure that any requests to that URL will be
> filtered
> through the StripesFilter according to the filter mappings in your web.xml.
>
>        at
> net.sourceforge.stripes.controller.StripesFilter.getConfiguration
> (StripesFilter.java:161)
>        at
> net.sourceforge.stripes.util.CryptoUtil.decrypt(CryptoUtil.java:181)
> ...
>
>
>
>
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to