Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
License Agreement. Rich Faces - Natural Ajax for Java Server Faces (JSF) Copyright (C) 2007 Exadel, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 package org.ajax4jsf.templatecompiler.elements.std;
Processing c:scriptObject

Nick Belaevski
 	private static final String TEMPLATE = .+"/scriptObject.vm";
 	private String variableName;
 	private String base;
 	private static final Class<?> VARIABLE_TYPE = HashMap.class;
 	public ScriptObjectTemplateElement(final Node element,
 			final CompilationContext componentBean) {
 		NamedNodeMap nnm = element.getAttributes();
 		Node varNode = nnm.getNamedItem("var");
 		if (varNode == null) {
 			throw new RuntimeException("'var' attribute required for c:scriptObject tag!");
 		 = varNode.getNodeValue();
 		Node baseNode = nnm.getNamedItem("base");
 		if (baseNode != null) {
 			 = ELParser.compileEL(baseNode.getNodeValue(), componentBean);
 		try {
 		} catch (CompilationException e) {
 			throw new RuntimeException(e.getMessage(), e);
 	private static ThreadLocal<StringvariableNamesStorage = new ThreadLocal<String>(); 
 		if (.get() != null) {
 			throw new CompilationException("Nested c:scriptObject tags aren't allowed!");
 		VelocityContext context = new VelocityContext();
 		return this.getComponentBean().processTemplate(getTemplateName(), context);

 	protected String getTemplateName() {
 		return ;
 	public String getEndElement() {
		return null;
	static String getVariableName() {
New to GrepCode? Check out our FAQ X