A. 怎麼解析通過WebService傳遞的XML格式的字元串
他們調用我們提供的WebService,方法為 string SendAData(string PsoData),他們傳遞了string類型的參數(裡面是xml格式的),我這邊怎麼處理比較好?怎麼序列化?
B. 在web.xml中classpath和classpath*的區別
classpath 和 classpath* 區別:
classpath:只會到你指定的class路徑中查找找文件;
classpath*:不僅包含class路徑,還包括jar文件中(class路徑)進行查找.
C. 載入模板配置文件出錯!D:\wwwroot\yztaolin\web\_template\template_1\channel_2\config.xml 請高手指示.
給個地址
D. 麻煩幫忙看一下web.xml中的代碼。幫忙寫上注釋。謝謝
<?xml version="1.0" encoding="ISO-8859-1"?> <!--xml版本與編碼 -->
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <!--模板-->
<web-app>
<display-name>finance</display-name> <!--一般是project名稱-->
<session-config>
<session-timeout>30</session-timeout> <!--session 失效時間-->
</session-config>
<welcome-file-list> <!-- 歡迎文件列表,就是web應用程序默認首頁 -->
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
E. 如何在web.py中提供xml訪問
根據要訪問的xml文件(如response.xml)創建一個XML模板。如果XML中有變數,就使用相應的模板標簽進行替換。下面是一個例子:
$def with (code)<?xml version="1.0"?><RequestNotification-Response><Status>$code</Status></RequestNotification-Response>
為了提供這個XML,需要創建一個單獨的web.py程序(如response.py),它要包含下面的代碼。注意:要用"web.header('Content-Type', 'text/xml')"來告知客戶端--正在發送的是一個XML文件。
import webrender = web.template.render('templates/', cache=False)urls = ('/(.*)', 'index')app = web.application(urls, globals())class index:def GET(self, code):web.header('Content-Type', 'text/xml')return render.index(code)web.webapi.internalerror = web.debugerrorif __name__ == '__main__': app.run()
F. web.xml servlet配置出錯 如圖
你把滑鼠移動到紅叉那裡, 看看顯示什麼錯誤。
或者這樣, 給你一個web.xml文件的基礎模板, 我看你貼出來web.xml文件少點東西:
<?xmlversion="1.0"encoding="UTF-8"?>
<web-appid="WebApp_ID"version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2eehttp://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>web</display-name>
<servlet>
<servlet-name>input</servlet-name>
<servlet-class>org.lxh.servletdemo.InputServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>input</servlet-name>
<url-pattern>/InputServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
G. web.xml中classpath:和classpath*:有什麼區別
首先 classpath指 WEB-INF文件夾classes目錄
解釋classes含義:
1.存放各種資源配置文件 eg.init.properties log4j.properties struts.xml
2.存放模板文件 eg.actionerror.ftl
3.存放class文件 應項目發src目錄編譯文件
總結:定位資源入口
知道發程句:慣例於配置 許改變想
於第二問題
涉及libclasses文件訪問優先順序問題: lib>classes
於性能影響應該范疇
classpath classpath* 區別:
classpath:class路徑查找找文件;
classpath*:僅包含class路徑包括jar文件(class路徑)進行查找.
H. freemarker 指令函數 顯示html標簽
不推薦。
要使用FreeMarker的標簽必須能夠被FreemarkerServlet截獲,然後解析加工成HTML
所以你直接上線FTL頁,為什麼要靜態和動態Web模板混合它
如果你真的想用。 。 web.xml文件中的freemarker攔截(攔截器開發的*。html頁面)
I. 新建的maven為什麼沒有web.xml
第一步,新建maven項目
第二步,選擇web模板
J. 配置java Servlet過濾器web.xml報錯
你要寫在<web-app>與</web-app>之間
<web-app>
是根元素.所有配置都要寫在裡面