2012-03-22 40 views
1
  String id = (String) request.getParameter("pid"); 
      String link1 = "http://www2.comp.cityu.edu.hk:8080/servlet/HCPconversationupperframe?pid=" + id; 
      String link2 = "http://www2.comp.cityu.edu.hk:8080/servlet/HCPconversationlowerframe?pid=" + id; 

      out.println("<frameset rows=\"75%,25%\">"); 
      out.println("<frame src=\"http://www2.comp.cityu.edu.hk:8080/servlet/HCPconversationupperframe?pid=id\" scrolling=\"auto\" >"); 
      out.println("<frame src=link2 scrolling=\"auto\" >"); 

我要讓我的鏈接像這樣http://www2.comp.cityu.edu.hk:8080/servlet/HCPconversationupperframe?pid=123,然後調用框架調用兩個servlet會,但是我不能添加變量HTML標籤內的鏈接,我該怎麼辦那。添加變量在HTML標籤中的Servlet

+0

我明白了,現在找到了,thak everyone – 2012-03-22 06:41:58

回答

0

首先,您可以連接打印標籤中的變量。

但是你應該真的使用JSP(或其他模板引擎)來輸出HTML。在一個servlet中編寫HTML使它很難管理。