Author: mareshkau
Date: 2009-09-29 06:56:42 -0400 (Tue, 29 Sep 2009)
New Revision: 17787
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4954
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp 2009-09-29
10:56:42 UTC (rev 17787)
@@ -0,0 +1,14 @@
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
+
+<html>
+ <body>
+
+ <f:view>
+ <h:form id="greetingForm">
+ <h1>Test for JBIDE-4954</h1>
+ <h:graphicImage value="#{resource['']}" />
+ </h:form>
+ </f:view>
+ </body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml 2009-09-29
10:56:42 UTC (rev 17787)
@@ -0,0 +1,13 @@
+<tests>
+ <test id="greetingForm">
+<FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+<H1 STYLE="-moz-user-modify: read-write;">
+<SPAN CLASS="vpe-text">
+Test for JBIDE-4954
+</SPAN>
+</H1>
+<IMG SRC="/.*jsf2test/WebContent/resources/" STYLE="-moz-user-modify:
read-write;"/>
+
+</FORM>
+ </test>
+</tests>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java 2009-09-29
10:24:21 UTC (rev 17786)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java 2009-09-29
10:56:42 UTC (rev 17787)
@@ -27,6 +27,10 @@
performContentTest("JBIDE/2550/jbide2550.xhtml"); //$NON-NLS-1$
}
+ public void testOfJSF2ResourceForEmptyString() throws Throwable{
+ performContentTest("JBIDE/4954/inputUserName.jsp"); //$NON-NLS-1$
+ }
+
@Override
protected String getTestProjectName() {
return JsfAllTests.IMPORT_JSF_20_PROJECT_NAME;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2009-09-29
10:24:21 UTC (rev 17786)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2009-09-29
10:56:42 UTC (rev 17787)
@@ -326,8 +326,13 @@
if(zipEntry!=null){
InputStream inputStream =
jarPackageFragmentRoot.getJar().getInputStream(zipEntry);
IPath stateLocation = VpePlugin.getDefault().getStateLocation();
- String fileName =
classPathResource.substring(classPathResource.lastIndexOf("/")+1,classPathResource.lastIndexOf("."));
//$NON-NLS-1$ //$NON-NLS-2$
- String fileExtension =
classPathResource.substring(classPathResource.lastIndexOf("."),classPathResource.length());
//$NON-NLS-1$
+
+ String fileName = null;
+ String fileExtension = null;
+ if(classPathResource.lastIndexOf(".")!=-1) { //$NON-NLS-1$ //added by
mareshkau, fix for JBIDE-4954
+ fileName =
classPathResource.substring(classPathResource.lastIndexOf("/")+1,classPathResource.lastIndexOf("."));
//$NON-NLS-1$ //$NON-NLS-2$
+ fileExtension =
classPathResource.substring(classPathResource.lastIndexOf("."),classPathResource.length());
//$NON-NLS-1$
+ }
if(fileName!=null && fileName.length()>0
&& fileExtension!=null && fileExtension.length()>0) {
File temporaryFile =File.createTempFile(