1

我正在使用 Struts 2.5 和 Tiles 3.0。

该项目在 Eclipse Juno 上运行良好。将项目单独导出到 Tomcat 8.0 服务器后,我在 Tiles 页面中遇到了问题。

Error 
HTTP Status 500 - Illegal character in path at index 18: file:///C:/Program Files/Apache Software Foundation/Tomcat 8.0/webapps/EMANv2.5/WEB-INF/tiles.xml
    
type Exception report
message Illegal character in path at index 18: file:///C:/Program Files/Apache Software Foundation/Tomcat 8.0/webapps/EMANv2.5/WEB-INF/tiles.xml
description The server encountered an internal error that prevented it from fulfilling this request.
    

例外:

java.lang.IllegalArgumentException: Illegal character in path at index 18: file:///C:/Program Files/Apache Software Foundation/Tomcat 8.0/webapps/EMANv2.5/WEB-INF/tiles.xml
    java.net.URI.create(Unknown Source)

        org.apache.struts2.tiles.StrutsWildcardServletApplicationContext.getResource(StrutsWildcardServletApplicationContext.java:105)
 org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadRawDefinitionsFromResources(CachingLocaleUrlDefinitionDAO.java:232)
    org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadRawDefinitionsFromResources(CachingLocaleUrlDefinitionDAO.java:225)       org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitionsFromResources(CachingLocaleUrlDefinitionDAO.java:203)      org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitions(CachingLocaleUrlDefinitionDAO.java:192)
org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadDefinitions(ResolvingLocaleUrlDefinitionDAO.java:68)        org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.checkAndloadDefinitions(CachingLocaleUrlDefinitionDAO.java:174)       org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinitions(CachingLocaleUrlDefinitionDAO.java:131)
        org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinition(CachingLocaleUrlDefinitionDAO.java:105)     org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinition(CachingLocaleUrlDefinitionDAO.java:49)      org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory.getDefinition(UnresolvingLocaleDefinitionsFactory.java:89)      org.apache.tiles.impl.BasicTilesContainer.getDefinition(BasicTilesContainer.java:286)       org.apache.tiles.impl.BasicTilesContainer.isValidDefinition(BasicTilesContainer.java:273)
        org.apache.tiles.TilesContainerWrapper.isValidDefinition(TilesContainerWrapper.java:88)
        org.apache.tiles.impl.mgmt.CachingTilesContainer.isValidDefinition(CachingTilesContainer.java:100)
        org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:139)
        org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208)
        com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:366)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:270)
        org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:252)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:97)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:260)
        org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:69)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:97)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:97)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:97)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:188)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:120)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:244)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:99)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:139)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:155)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:174)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:97)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:130)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:193)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        nic.mh.eman.login.LoginInterceptor.intercept(LoginInterceptor.java:34)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:54)
        org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:556)
        org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81)
        org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:113)
    
    root cause
    
    java.net.URISyntaxException: Illegal character in path at index 18: file:///C:/Program Files/Apache Software Foundation/Tomcat 8.0/webapps/EMANv2.5/WEB-INF/tiles.xml
        java.net.URI$Parser.fail(Unknown Source)
        java.net.URI$Parser.checkChars(Unknown Source)
        java.net.URI$Parser.parseHierarchical(Unknown Source)
        java.net.URI$Parser.parse(Unknown Source)
        java.net.URI.<init>(Unknown Source)
        java.net.URI.create(Unknown Source)
        org.apache.struts2.tiles.StrutsWildcardServletApplicationContext.getResource(StrutsWildcardServletApplicationContext.java:105)
        org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadRawDefinitionsFromResources(CachingLocaleUrlDefinitionDAO.java:232)
        org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadRawDefinitionsFromResources(CachingLocaleUrlDefinitionDAO.java:225)
        org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitionsFromResources(CachingLocaleUrlDefinitionDAO.java:203)
        org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitions(CachingLocaleUrlDefinitionDAO.java:192)
        org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadDefinitions(ResolvingLocaleUrlDefinitionDAO.java:68)
        org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.checkAndloadDefinitions(CachingLocaleUrlDefinitionDAO.java:174)
        org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinitions(CachingLocaleUrlDefinitionDAO.java:131)
        org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinition(CachingLocaleUrlDefinitionDAO.java:105)
        org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinition(CachingLocaleUrlDefinitionDAO.java:49)
        org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory.getDefinition(UnresolvingLocaleDefinitionsFactory.java:89)
        org.apache.tiles.impl.BasicTilesContainer.getDefinition(BasicTilesContainer.java:286)
        org.apache.tiles.impl.BasicTilesContainer.isValidDefinition(BasicTilesContainer.java:273)
        org.apache.tiles.TilesContainerWrapper.isValidDefinition(TilesContainerWrapper.java:88)
        org.apache.tiles.impl.mgmt.CachingTilesContainer.isValidDefinition(CachingTilesContainer.java:100)
        org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:139)
        org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208)
        com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:366)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:270)
        org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:252)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:97)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:260)
        org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:69)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:97)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:97)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:133)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:97)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:188)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.interceptor.DateTextFieldInterceptor.intercept(DateTextFieldInterceptor.java:120)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:244)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:99)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:139)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:155)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:174)
        com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:97)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:130)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
        com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:240)
        com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)

        

note The full stack trace of the root cause is available in the Apache Tomcat/8.0.44 logs.
Apache Tomcat/8.0.44

tiles.xml

 <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE tiles-definitions PUBLIC
            "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
            "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
    
    <tiles-definitions>
        <definition name="homeLayout" template="/eman/homeLayout.jsp">
            <put-attribute name="title" value="EMAN" />
            <put-attribute name="header" value="/template/headerLayout.jsp" />
            <!-- <put-attribute name="navLeft" value="/template/leftLayout.jsp"/> -->
            <put-attribute name="body" value="" />
            <put-attribute name="footer" value="/template/footerLayout.jsp" />
        </definition>
        <definition name="home" extends="homeLayout">
            <put-attribute name="body" value="/eman/bodyLayout.jsp" />
        </definition>
        
        <definition name="contactus" extends="homeLayout">
            <put-attribute name="body" value="/eman/contactus.jsp" />
        </definition>
        
        <definition name="escalation" extends="homeLayout">
            <put-attribute name="body" value="/eman/escalation.jsp" />
        </definition>
        
        <definition name="callreport" extends="homeLayout">
            <put-attribute name="body" value="/eman/callReport.jsp" />
        </definition>
        <definition name="callReportSuccess" extends="homeLayout">
            <put-attribute name="body" value="/eman/success.jsp" />
        </definition>
        <definition name="callReportUpdateRequest" extends="homeLayout">
            <put-attribute name="body" value="/eman/updateCallReport.jsp" />
        </definition>
        <definition name="approvedItemDisplay" extends="homeLayout">
            <put-attribute name="body" value="/eman/store/approvedItemDisplay.jsp" />
        </definition>
        <definition name="callReportUpdateList" extends="homeLayout">
            <put-attribute name="body" value="/eman/callUpdateAllList.jsp" />
        </definition>
        <definition name="requestedItemList" extends="homeLayout">
            <put-attribute name="body" value="/eman/store/requestedItemList.jsp" />
        </definition>
        <definition name="requestApprovalItem" extends="homeLayout">
            <put-attribute name="body" value="/eman/store/requestApprovalItemList.jsp" />
        </definition>
        <definition name="callReportUpdate" extends="homeLayout">
            <put-attribute name="body" value="/eman/updateCallReport.jsp" />
        </definition>
        <definition name="storeReceipt" extends="homeLayout">
            <put-attribute name="body" value="/eman/store/newStoreReceipt.jsp" />
        </definition>
        <definition name="requestItem" extends="homeLayout">
            <put-attribute name="body" value="/eman/store/requestItems.jsp" />
        </definition>
        <!-- Issue the items to the employee -->
        <definition name="appprovedItemList" extends="homeLayout">
            <put-attribute name="body" value="/eman/issue/appprovedItemList.jsp" />
        </definition>
        <definition name="requestIssueItem" extends="homeLayout">
            <put-attribute name="body" value="/eman/issue/requestIssuelItemList.jsp" />
        </definition>
        <definition name="issuedItemDisplay" extends="homeLayout">
            <put-attribute name="body" value="/eman/issue/issuedItemDisplay.jsp" />
        </definition>
        <!-- Move items to store for requestation  -->
       <definition name="requestSearchItemsList" extends="homeLayout">
            <put-attribute name="body" value="/eman/itemUtility/searchItemsList.jsp" />
        </definition>
           <definition name="searchItemsList" extends="homeLayout">
            <put-attribute name="body" value="/eman/itemUtility/searchItemsList.jsp" />
        </definition>
        <!-- Pm Updation -->
        <definition name="pmUpdate" extends="homeLayout">
            <put-attribute name="body" value="/eman/pmUpdation.jsp" />
        </definition>
        <definition name="pmUpdateSuccess" extends="homeLayout">
            <put-attribute name="body" value="/eman/success.jsp" />
        </definition>
        <!-- Move items to store for requestation  -->
       <definition name="requestSearchItemsListForPM" extends="homeLayout">
            <put-attribute name="body" value="/eman/itemUtility/searchItemsListForPM.jsp" />
        </definition>
           <definition name="searchItemsListForPM" extends="homeLayout">
            <put-attribute name="body" value="/eman/itemUtility/searchItemsListForPM.jsp" />
        </definition>
        
        <!-- Move items to store for requestation  -->
       
        <definition name="requestSetPenanltyofItem" extends="homeLayout">
            <put-attribute name="body" value="/eman/itemUtility/setPenalty.jsp" />
        </definition>
        
        <!-- PM penalty -->
       
        <definition name="RequestForSetPmPenanltyofItem" extends="homeLayout">
            <put-attribute name="body" value="/eman/itemUtility/setPmPenalty.jsp" />
        </definition>
        
            <!-- Group Master -->
       
        <definition name="groupList" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/groupList.jsp" />
        </definition>
         <definition name="newGroup" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/group.jsp" />
        </definition>
        
         <definition name="editGroup" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/editGroup.jsp" />
        </definition>
        
        <!-- Item Master -->
       
        <definition name="itemList" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/itemList.jsp" />
        </definition>
         <definition name="newItem" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/item.jsp" />
        </definition>
        
         <definition name="editItem" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/editItem.jsp" />
        </definition>
        
        <!-- State Master -->
       
        <definition name="stateList" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/stateList.jsp" />
        </definition>
         <definition name="newState" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/state.jsp" />
        </definition>
        
         <definition name="editState" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/editState.jsp" />
        </definition>
        
        
        <!-- District Master -->
       
        <definition name="districtList" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/districtList.jsp" />
        </definition>
         <definition name="newDistrict" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/district.jsp" />
        </definition>
        
         <definition name="editDistrict" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/editDistrict.jsp" />
        </definition>
        
        <!-- Location Master -->
       
        <definition name="locationList" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/locationList.jsp" />
        </definition>
         <definition name="newLocation" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/location.jsp" />
        </definition>
        
         <definition name="editLocation" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/editLocation.jsp" />
        </definition>
        
            <!-- Vendor Master -->
        <definition name="vendorList" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/vendorList.jsp" />
        </definition>
         <definition name="newVendor" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/vendor.jsp" />
        </definition>
        
         <definition name="editVendor" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/editVendor.jsp" />
        </definition>
        
        
        <!-- Holiday Master  -->
       
        <definition name="holidayMaster" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/searchHolidayMaster.jsp" />
        </definition>
        <definition name="holidayList" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/holidayList.jsp" />
        </definition>
         <definition name="newHoliday" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/holiday.jsp" />
        </definition>
        
         <definition name="editHoliday" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/editHoliday.jsp" />
        </definition>
        
        
                <!-- Problem Master -->
        <definition name="problemList" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/problemList.jsp" />
        </definition>
         <definition name="newProblem" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/problem.jsp" />
        </definition>
        
         <definition name="editProblem" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/editProblem.jsp" />
        </definition>
        
                <!-- Problem Master -->
        <definition name="holidayLeaveList" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/holidayLeaveList.jsp" />
        </definition>
         <definition name="newHolidayLeave" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/holidayLeave.jsp" />
        </definition>
        
         <definition name="editHolidayLeave" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/editHolidayLeave.jsp" />
        </definition>
        
        
            <!-- Employee Master -->
        <definition name="employeeList" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/employeeList.jsp" />
        </definition>
         <definition name="newEmployee" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/employee.jsp" />
        </definition>
        
         <definition name="editEmployee" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/editEmployee.jsp" />
        </definition>
        
         <definition name="assignRoles" extends="homeLayout">
            <put-attribute name="body" value="/eman/master/assignRoles.jsp" />
        </definition>
    
            <!-- User Profile -->
        <definition name="editProfile" extends="homeLayout">
            <put-attribute name="body" value="/eman/user/userProfile.jsp" />
        </definition>
            
    </tiles-definitions>

web.xml

 <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee" 
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
   http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" 
   version="2.5">
      <display-name>EVATS</display-name>
         <listener>
    <listener-
     class>org.apache.struts2.tiles.StrutsTilesListener</listener-
     class>
    </listener>
      <filter>
        <filter-name>struts2</filter-name>
        <filter-class>
       org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
      
       </filter-class>
        <init-param>
            <param-name>struts.action.extension</param-name>
            <param-value>,</param-value>
        </init-param>
      </filter>
      <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
      </filter-mapping>
       <session-config>
        <session-timeout>15</session-timeout>
      </session-config>
        <welcome-file-list>
        <welcome-file>index.html</welcome-file>
      </welcome-file-list>
    </web-app>

struts2.xml

<?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    <struts>
    <constant name="struts.devMode" value="false" />
    <constant name="struts.enable.DynamicMethodInvocation" value="false" />
    <constant name="struts.custom.i18n.resources" value="global" />
    <constant name="struts.locale" value="en" />
    <include file="main-default.xml" />
     </struts>
           
4

1 回答 1

1

这是一个类似于Bug 148195 - IllegalArgumentException: Illegal character in path at index 36: file:/Applications/NetBeans/NetBeans Dev 200809240201.app/Contents/Resources/NetBeans/ide10/modules/ext/mysql-connector-java- 5.1.6-bin。.

Vadiraj Deshpande 2008-09-24 13:50:52 UTC

这个问题是因为使用 java.io.File 然后转换为 java.net.URL。在少数系统上,java.io.File 不会将文件路径中的空格转换为“%20”。使用 org.openide.filesytem.FileObject 解决了这个问题,但是 InstalledFileLocator 返回 java.io.File 并转换为 FileObject (FileUtil.toFileObject()) 并不能解决这个问题。调查..

评论 4 Vadiraj Deshpande 2008-10-01 21:24:17 UTC

此问题在 Windows 上突出显示。(其中 NetBeans 安装在包含空格的路径上,例如 C:\Program Files\NetBeans ..)该问题需要在 6.5 中解决。根本原因在最后一条评论中进行了解释,修复很简单。提高优先级。

评论 5 Vadiraj Deshpande 2008-10-02 21:28:15 UTC

固定的。(使用 file.toURI().toURL() 而不仅仅是 file.toURL()。根据 JDK javadoc,这是获取转义文件路径所必需的)。 http://hg.netbeans.org/main/rev/ef42f02107ba

我推荐使用最新的 Struts 版本的插件,这个 bug 已经修复。从项目存储库中查看当前版本的StrutsWildcardServletApplicationContext.java 。

于 2017-06-27T09:35:29.923 回答