Comments (11)
Found out from, UndertowDeploymentProcessor.java:
TldsMetaData tldsMetaData = deploymentUnit.getAttachment(TldsMetaData.ATTACHMENT_KEY);
// and the rabbit holes goes deeper with other dependency.
and also from here, as shown by Stuart Douglas:
https://github.com/undertow-io/jastow/blob/master/src/test/java/io/undertow/test/jsp/taglib/TagLibJspTestCase.java
Map<String, TagLibraryInfo> tags = new HashMap<>();
TagLibraryInfo bugTld = new TagLibraryInfo();
bugTld.setUri("/bug.tld");
bugTld.setPath("/bug.tld");
bugTld.setVersion("2.0");
bugTld.setTlibversion("1.1");
FunctionInfo functionInfo = new FunctionInfo();
functionInfo.setName("dummy");
functionInfo.setFunctionSignature("java.lang.Runtime getRuntime()");
functionInfo.setFunctionClass("java.lang.Runtime");
bugTld.addFunctionInfo(functionInfo);
tags.put("/bug.tld", bugTld);
// THIS is where I was pointed to by Stuart
JspServletBuilder.setupDeployment(builder, new HashMap<String, JspPropertyGroup>(), tags, new HackInstanceManager());
There should be a constant value hashmap or a way to load JSTL since it is common standard.
Map<String, TagLibraryInfo> tags = new HashMap<>();
from jastow.
Manual Construction of TagMap is needed and not an effective approach to loading support JSTL.
from jastow.
The following dependency had been added to pom.xml
<repositories>
<repository>
<id>redhat.com</id>
<url>http://maven.repository.redhat.com/techpreview/all/</url>
</repository>
</repositories>
<!-- Jasper+Undertow for JSP -->
<dependency>
<groupId>io.undertow.jastow</groupId>
<artifactId>jastow</artifactId>
<version>2.0.0.Beta3</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.servlet.jstl</groupId>
<artifactId>jboss-jstl-api_1.2_spec</artifactId>
<version>1.0.6.Final-redhat-1</version>
</dependency>
from jastow.
you should be using jboss-jstl-api_1.2_spec version 1.1.x for usage with servlet 3.1 implementations such as undertow.
from jastow.
pretty much all reason for your problems lies here https://github.com/gencube/Jee7EgJastow/blob/master/src/main/java/mi/webmach/jee/WebXml.java#L95
where you don't configure tld mappings as pass empty map.
for reference you can look at how we configure it in WildFly during deployment
https://github.com/wildfly/wildfly/blob/master/undertow/src/main/java/org/wildfly/extension/undertow/deployment/UndertowDeploymentInfoService.java#L638-L644
from jastow.
Hi, Thanks for replying.
HashMap<String, TagLibraryInfo> tldInfo = createTldsInfo(tldsMetaData, sharedTlds);
The code fragment shown is implicating too many dependencies indirectly and I needed to do a wild goose chase.
What do I change this line to make it works?
JspServletBuilder.setupDeployment(info, new HashMap<String, JspPropertyGroup>(), new HashMap<String, TagLibraryInfo>(), new HackInstanceManager());
// I understand that it is only this portion needed to be change.
HashMap<String, TagLibraryInfo>()
from jastow.
What are the values to be placed within these two variables?
TldsMetaData tldsMetaData = ??;
List<TldMetaData> sharedTlds = new ArrayList<>();
sharedTlds.add(??);
from jastow.
Hi Thomas,
What is the status of this issue?
Since JSTL 1.2 is a standard library, how do I patch that code into Jastow?
from jastow.
This code was newly added, BUT error still exist:
JspServletBuilder.setupDeployment(builder, new HashMap<String, JspPropertyGroup>(), toJSTL() , new HackInstanceManager());
...
public static Map<String, TagLibraryInfo> toJSTL() {
Map<String, TagLibraryInfo> tags = new HashMap<>();
String[][] jstlInfos = {
{"http://java.sun.com/jstl/core_rt", "c-1_0-rt.tld", "1.0", "1.0"},
{"http://java.sun.com/jstl/core", "c.tld", "1.0", "1.1"},
{"http://java.sun.com/jsp/jstl/functions", "fn.tld", "1.0", "1.1"},
{"http://java.sun.com/jstl/fmt_rt", "fmt-1_0-rt.tld", "1.0", "1.0"},
{"http://java.sun.com/jstl/fmt", "fmt.tld", "1.0", "1.1"},
{"http://java.sun.com/jsp/jstl/sql", "sql.tld", "1.0", "1.1"},
{"http://java.sun.com/jstl/sql_rt", "sql-1_0-rt.tld", "1.0", "1.1"},
{"http://java.sun.com/jsp/jstl/xml", "x.tld", "1.0", "1.1"},
{"http://java.sun.com/jstl/xml_rt", "x-1_0-rt.tld", "1.0", "1.1"}
};
for (String[] jstlinfo : jstlInfos) {
TagLibraryInfo info = new TagLibraryInfo();
info.setUri(jstlinfo[0]);
info.setPath("/META-INF/"+jstlinfo[1]);
info.setVersion(jstlinfo[2]);
info.setTlibversion(jstlinfo[3]);
tags.put("/"+jstlinfo[1], info);
}
return tags;
}
from jastow.
I have a working version of tag discovery for jastow. The current caveat is that it depends on jboss-metadata-web and jboss-metadata-common but I can get rid of them and provide a helper to be used while configuring jastow with undertow via JspServletBuilder.setupDeployment(...)
.
Something like Map<String, TagLibraryInfo> TldClasspathHelper.find()
@gencube @ctomc Is this something that will be useful to include in jastow for general use?
from jastow.
Sorry for the late reply. The answer is yes.
from jastow.
Related Issues (15)
- Sample wih custom tag integration HOT 9
- Update Jastow to the latest Apache Jasper HOT 1
- Map<String, TagLibraryInfo> tags = new HashMap<>(); Does NOT works. HOT 8
- Cannot support Spring view JSP. HOT 1
- Calling the JspServlet by a background thread HOT 1
- Malformed URL for tag dependant HOT 2
- How to use this library? HOT 2
- the test case running error
- Cannot be used in spring boot HOT 3
- Suggestion of a simple web app that uses JSP+Jastow+Wildfly
- Bugs Could Occur When Importing Jar undertow-servlet-1.4.20.Final.jar in This Project
- JspServletWrapper.handleJspException can throws NullPointerException HOT 1
- First Good Issue
- Update README.md
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jastow.