index.jsp
资源名称:WAPpush.zip [点击查看]
上传用户:weisa_1
上传日期:2007-10-14
资源大小:287k
文件大小:3k
源码类别:
手机WAP编程
开发平台:
Java
- <%--
- Mobile Zoo Push service example
- index.jsp
- --%>
- <%@ page import="javax.servlet.*" %>
- <%@ page import="javax.servlet.http.*" %>
- <%@ page import="java.io.*" %>
- <%@ page contentType="text/vnd.wap.wml" %>
- <?xml version="1.0"?>
- <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
- <!-- The front page of the Mobile Zoo Information Pages -->
- <wml>
- <!-- provides a way back using the prev element -->
- <template>
- <do type="prev">
- <prev/>
- </do>
- </template>
- <%--
- Session tracking.
- HttpSession interface is utilised in this example.
- First a check is performed whether the request includes a "cookie" header and
- a validity test based on the requested session id.
- If the client user agent is checked not to support cookies, URL rewriting is used instead.
- In that the session id is encoded as a path parameter in the resulting URL string.
- --%>
- <%
- boolean cookiesCheck = request.getHeader("cookie") != null && request.isRequestedSessionIdValid();
- final String jsessionID = cookiesCheck ? "" : ";jsessionid=" + session.getId();
- %>
- <!-- Information pages. First card -->
- <card id="main" title="Push Info pages">
- <p align="center">
- <do type="accept" label="Members" name="members">
- <go href="servlet/members<%= jsessionID %>"/>
- </do>
- <do type="accept" label="Info" name="info">
- <go href="servlet/info<%= jsessionID %>"/>
- </do>
- <do type="accept" label="Ads" name="ads">
- <go href="servlet/commercials<%= jsessionID %>"/>
- </do>
- <do type="accept" label="Feedback" name="feedback">
- <go href="servlet/feedback<%= jsessionID %>"/>
- </do>
- <do type="accept" label="New member" name="newmember">
- <go method="post" href="servlet/members<%= jsessionID %>">
- <postfield name="action" value="new"/>
- </go>
- </do>
- <do type="accept" label="Tell a friend" name="friend">
- <go method="post" href="push/recommend<%= jsessionID %>"/>
- </do>
- <anchor title="Members">Members
- <go href="servlet/members<%= jsessionID %>"/>
- </anchor>
- <br/>
- <anchor title="Info">Info
- <go href="servlet/info<%= jsessionID %>"/>
- </anchor>
- <br/>
- <anchor title="Ads">Ads
- <go href="servlet/commercials<%= jsessionID %>"/>
- </anchor>
- <br/>
- <anchor title="Feedback">Feedback
- <go href="servlet/feedback<%= jsessionID %>"/>
- </anchor>
- <br/>
- <anchor title="New member">New member
- <go href="servlet/members<%= jsessionID %>">
- <postfield name="action" value="new"/>
- </go>
- </anchor>
- <br/>
- <anchor title="Tell a friend">Tell a friend
- <go href="servlet/recommend<%= jsessionID %>"/>
- </anchor>
- </p>
- </card>
- <!-- end of the page -->
- </wml>