[tools] Initial coding and example of JSP taglib directive mojo available

2010-12-16 Thread Antonio Petrelli
Hi all
I would like you to know that I've committed a first version of the
taglib2directive mojo, that wraps JSP tag libraries into Velocity
directives.
The module itself is:
http://svn.apache.org/repos/asf/velocity/tools/trunk/maven-velocity-tools-plugin/
You can see it working in a new example module in the examples:
http://svn.apache.org/repos/asf/velocity/tools/trunk/velocity-tools-examples/displaytag-directive/
(yes, it's DisplayTag)
It is used in the showcase application:
http://svn.apache.org/repos/asf/velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/

Currently the plugin works partially (only for TLD 1.2 and for classic
tags, not "simple ones) and it must be polished, but essentially it
works.

Have fun
Antonio

-
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org



[jira] Resolved: (VELOCITY-786) NullPointerException while evaluating template

2010-12-16 Thread Pawel Urban (JIRA)

 [ 
https://issues.apache.org/jira/browse/VELOCITY-786?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pawel Urban resolved VELOCITY-786.
--

   Resolution: Fixed
Fix Version/s: 1.6.4

The problem had very simple cause - Log.

I temporarily fixed the problem by 

Velocity.setProperty("runtime.log"logsystem.class", 
"org.apache.velocity.runtime.log.NullLogSystem");

just before init.

> NullPointerException while evaluating template
> --
>
> Key: VELOCITY-786
> URL: https://issues.apache.org/jira/browse/VELOCITY-786
> Project: Velocity
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: 1.6.4
> Environment: FreeBSD 8.0, Java(TM) SE Runtime Environment (build 
> 1.6.0_03-p4-root_19_oct_2010_22_21-b00), Apache Tomcat/6.0.29, Spring 2.5
>Reporter: Pawel Urban
> Fix For: 1.6.4
>
>
> While evaluating template with Velocity I am affecting:
> java.lang.NullPointerException
>   
> org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1103)
>   
> org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1086)
>   
> org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1199)
>   
> org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1165)
>   org.apache.velocity.app.Velocity.evaluate(Velocity.java:191)
>   
> pl.pollub.cafe.zeusx.modules.report.ReportController.generateWorkersSchedule(ReportController.java:300)
>   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>   
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>   java.lang.reflect.Method.invoke(Method.java:597)
>   
> org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)
>   
> org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)
>   
> org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:326)
>   
> org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:313)
>   
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
>   
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
>   
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
>   
> org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>   
> pl.pollub.cafe.zeusx.commons.spring.FlashScopeFilter.doFilterInternal(FlashScopeFilter.java:33)
>   
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>   
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
>   
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> exception.
> Code which is being executed:
> try {
>   Velocity.init();
>   } catch (Exception e1) {
>   e1.printStackTrace();
>   }
> then
> try {
>   Velocity.evaluate( context, writer, "string", 
> template.getSzablon());
>   } catch (ParseErrorException e) {
>   e.printStackTrace();
>   } catch (MethodInvocationException e) {
>   e.printStackTrace();
>   } catch (ResourceNotFoundException e) {
>   e.printStackTrace();
>   } catch (IOException e) {
>   e.printStackTrace();
>   }
> This code does not on production server, but works on development machines. I 
> have tried using VelocityEngine instetad of Velocity Signleton but no luck.
> I also tried initializing Velocity during servlet startup but nothing 
> changed. Any help appreciated :-)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


-
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org



Re: [tools] Ideas about future Velocity Tools features

2010-12-16 Thread Christopher Schultz
Antonio,

On 12/10/2010 3:43 AM, Antonio Petrelli wrote:
> Who used DisplayTag knows what I
> mean: a tag library that manages sorting and pagination (internal and
> external), alternate coloring etc. IOW, all the aspects of a table of
> results that you might imagine.

I've developed what I think is a great Velocimacro that acts as a pager.
116 lines including comments, debug output, etc. I'd be happy to share
it with the community... I'd probably get feedback about how it could be
improved :)

The AlternatorTool does a great job for alternate coloring.

Does DisplayTag do anything on top of those, or is the idea that it's
all rolled into one tag so you don't have to piece-together your solution?

-chris



signature.asc
Description: OpenPGP digital signature