jsp 里的代码 想改变成 asp 里的,请会的朋友帮忙
在jsp页面上的一段 简单的java 代码,现在想嵌入到 asp 上。。
我是 转行学java 的,所以从来没学过asp ,烦请会的朋友 帮下忙。谢谢了
<%
String stock_code=request.getParameter( "stock_code ");
String var1= " ";
String var2= " ";
String var3= " ";
String var4= " ";
String var5= " ";
String var6= " ";
String vart1= " ";
String vart2= " ";
String vart3= " ";
String vart4= " ";
String vart5= " ";
String vart6= " ";
if(stock_code.startsWith( "HK ")){
var1= "hk/corp_background.jsp ";
var2= "hk/busi_survey.jsp ";
var3= "hk/corp_structure.jsp ";
var4= "hk/profitloss_sheet.jsp ";
var5= "hk/balance_sheet.jsp ";
var6= "hk/payout_report.jsp ";
vart1= "会社情報 ";
vart2= "業務概要 ";
vart3= "企業構成 ";
vart4= "損益表 ";
vart5= "負債表 ";
vart6= "分割配布 ";
}
else if(stock_code.startsWith( "00 ")||stock_code.startsWith( "60 ")){
var1= "a/corp_intro.jsp ";
var2= "a/chief_survey.jsp ";
var3= "a/finance_data.jsp ";
var4= "a/finance_lable.jsp ";
var5= "a/make_up.jsp ";
var6= "a/melon_cutting.jsp ";
vart1= "会社概要 ";
vart2= "重要指標 ";
vart3= "財務データ ";
vart4= "財務指標 ";
vart5= "株資本構成 ";
vart6= "分割配布配当 ";
System.out.println( "aaaaaaaaa ");
}
else{
var1= "b/corp_intro.jsp ";
var2= "b/chief_survey.jsp ";
var3= "b/finance_data.jsp ";
var4= "b/finance_lable.jsp ";
var5= "b/make_up.jsp ";
var6= "b/melon_cutting.jsp ";
vart1= "会社概要 ";
vart2= "重要指標 ";
vart3= "財務データ ";
vart4= "財務指標 ";
vart5= "株資本構成 ";
vart6= "分割配布配当 ";
}
%>
另外是不是变量嵌入 到 asp 中 也要使用 <%= %> 。
------解决方案--------------------jfjf
------解决方案--------------------asp代码放在 <% %> 中就可以了
<%= var%> 会把变量var输出到页面上
------解决方案--------------------System.out.println( "aaaaaaaaa ");
等效于asp的
response.write( "aaaaaaaa ")
String stock_code=request.getParameter( "stock_code ");
等效于asp的
String stock_code=request.form( "stock_code ")
if(stock_code.startsWith( "HK "))
asp的
tmpStr= "HK "
if Instr(1, tmpStr, stock_code, 1) =0 then
var1= "hk/corp_background.jsp "
end if
大概就是这样了,ASP很久没用了
------解决方案--------------------稍微改一下 只有少许的不同