sql 2008注册服务器失败!viewinfo无效。

C:\window\.net2.0\confif..

<sectionGroup name="system.serviceModel" type="System.ServiceModel.Configuration.ServiceModelSectionGroup,

System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <section name="behaviors" type="System.ServiceModel.Configuration.BehaviorsSection, System.ServiceModel,

Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            <section name="bindings" type="System.ServiceModel.Configuration.BindingsSection, System.ServiceModel,

Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            <section name="client" type="System.ServiceModel.Configuration.ClientSection, System.ServiceModel,

Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            <section name="comContracts" type="System.ServiceModel.Configuration.ComContractsSection,

System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            <section name="commonBehaviors" type="System.ServiceModel.Configuration.CommonBehaviorsSection,

System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowDefinition="MachineOnly"

allowExeDefinition="MachineOnly"/>
            <section name="diagnostics" type="System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel,

Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            <section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel,

Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            <section name="machineSettings" type="System.ServiceModel.Configuration.MachineSettingsSection,

SMDiagnostics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowDefinition="MachineOnly"

allowExeDefinition="MachineOnly"/>
            <section name="serviceHostingEnvironment"

type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0,

Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            <section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel,

Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
        </sectionGroup>
        <sectionGroup name="system.serviceModel.activation"

type="System.ServiceModel.Activation.Configuration.ServiceModelActivationSectionGroup, System.ServiceModel,

Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <section name="diagnostics" type="System.ServiceModel.Activation.Configuration.DiagnosticSection,

System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            <section name="net.pipe" type="System.ServiceModel.Activation.Configuration.NetPipeSection,

System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            <section name="net.tcp" type="System.ServiceModel.Activation.Configuration.NetTcpSection,

System.ServiceModel, Version=3.0.0.0, Culture=neutral, Pu

 

好的,以下是你要求的JavaWeb应用程序的设计: 1. CustomServletContextListener.java ``` import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class CustomServletContextListener implements ServletContextListener { @Override public void contextInitialized(ServletContextEvent sce) { ServletContext servletContext = sce.getServletContext(); // 向ServletContext对象中存储三个属性 servletContext.setAttribute("sno", "你的学号"); servletContext.setAttribute("name", "你的姓名"); servletContext.setAttribute("gender", "你的性别"); } @Override public void contextDestroyed(ServletContextEvent sce) { // do nothing } } ``` 2. SelfInfoServlet.java ``` import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletContext; public class SelfInfoServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // 获取ServletContext对象 ServletContext servletContext = request.getServletContext(); // 获取三个属性 String sno = (String) servletContext.getAttribute("sno"); String name = (String) servletContext.getAttribute("name"); String gender = (String) servletContext.getAttribute("gender"); // 拼接字符串 String selfInfo = "学号:" + sno + ",姓名:" + name + ",性别:" + gender; // 存储到request对象中 request.setAttribute("selfInfo", selfInfo); // 请求转发到viewInfo.jsp页面 request.getRequestDispatcher("/viewInfo.jsp").forward(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } } ``` 3. visit.jsp ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Visit Page</title> </head> <body> <a href="${pageContext.request.contextPath}/info">访问SelfInfoServlet</a> </body> </html> ``` 4. viewInfo.jsp ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>View Info</title> </head> <body> ${selfInfo} </body> </html> ``` 以上是你要求的JavaWeb应用程序的设计,你可以将代码复制到相应的Java文件中,并在web.xml文件中配置CustomServletContextListener和SelfInfoServlet的映射关系,最后部署到Tomcat服务器中运行。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值