2013-12-16 103 views
0

I am creating a web application with header containing a menu bar which contains 2 level of children.Now as part of second requirement I am creating a breadcrumb, as part of that I am trying to show the user where they are in the application.For that,I thought to use the URL itself and just show it on the UI,where each hyperlink will be separated by forward slash("/").JSP <a href=" ">is not able to hold regular statement

part of index.jsp where I am writing from the java code to jsp

out.println("<li><a href=result?id="+keyinner+"/"+key+"/"+secKey+"/"+**innerhashMap.get(keyinner)**+"><span>"+innerhashMap.get(keyinner)+"</span></a></li>"); 

innerhashMap.get(keyinner) gives the last vertical menu bar as shown in the image.I want to have the complete string which is selected in the bold part of href but only first letter is coming up.I don't find any reason for that.Could you please help me out

Thanks in advance

Menu Bar

回答

0

您缺少href =「」的引號。沒有它們,你的href將在第一個空間中斷。

out.println("<li><a href=\"result?id="+...+"\">....."); 

另外,如果您的文本包含<或>符號,你需要轉換那些爲HTML實體,& LT;和& gt ;.否則,諸如<hello>這樣的文本將被視爲HTML標籤(並且變得不可見),而不是顯示爲文本。

+0

真棒第三隻眼睛.Kudoss !!!這是答案 –

相關問題