📄 shownewsll.java
字号:
import java.io.*;
import java.text.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ShowNewsLL extends HttpServlet
{
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException
{
doGet(request,response);
}
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException
{
HtmlOut htmlOut = new HtmlOut (response);
String sSrc1 = request.getParameter("src1");
String sSrc2 = request.getParameter("src2");
if(sSrc1==null ||sSrc2==null){
return;
}
String sType = request.getParameter("type");
TemplateList tempList;
//get template and ...
int type =0;
if( sType==null )
tempList= CommonMethods.getNewsLLTemplate ();
else{
tempList= CommonMethods.getNewsLLTemplate1 ();
type =1;
}
if(tempList!=null){
SingleTemplate st = tempList.searchTemplate ("ROOT");
for(int i=0;i<st.getKeyNum ();i++){
String sKey = st.getKeyAt (i);
htmlOut.addString (st.getStringAt (i));
if( sKey .compareTo("cgi-path")==0 )
htmlOut.addString (CommonMethods.sHostNameCGI);
if(type ==0){
if(sKey.compareTo ("src1")==0){
htmlOut.addString ( "/b/gscp/xinxi_1/"+sSrc1+".htm" );
}
if(sKey.compareTo ("src2")==0){
htmlOut.addString ( "/ShowNewsSingleTitle?cateid="
+sSrc2 );
}
}
if(type ==1){
if(sKey.compareTo ("src1")==0){
htmlOut.addString ( sSrc1);
}
if(sKey.compareTo ("src2")==0){
htmlOut.addString ( sSrc2 );
}
}
}
htmlOut.addString(st.getEndString ());
}
htmlOut.outHtml ();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -