如何将单页jsp文件分解为可管理的代码块,同时将所有代码保存在单个文件中?相当于将一个类分解成几个方法,但将其全部保存在一个文件中。例如:
<body>
<div id="main_container">
# include header
# include search form
# include search results table
# include footer
</div>
</body>
# header code ########
我有一个现有的普通jsp web应用程序。根据客户的要求,我需要创建一些配置页面,下拉选择框。我必须在Struts 2中创建这个页面,我已经创建了一个struts页面,但是我无法从我现有的应用程序中调用这个struts2页面。
我的错误越来越少。
The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed throu
我已经使用数据库中的转义字符将引号(“)保存在一个字符串中。这是可以工作的。但是当我从数据库中检索jsp字段中的值时,字符串在整个字符串中得到的第一个引号处结束。我给出一个例子:
让我们以我在数据库中存储的字符串为-
" Hello David. This is a "customer"."
现在,我需要将字符串从数据库中保存回jsp页面的隐藏字段中,如下所示-
<input type="hidden" name="string_from_database" id="string_from_database"
如何从jsp包含引用一个jsp的链接内容?
index.jsp
<%@ include file="link.jsp"%>
<html>
//can I get the link.jsp link from here with this include?
</html>
link.jsp
<html>
<a href"someplace"></a> <--I want this to be a reference to other jsps
</html&
这几天我正在建一个网站,我被它的页面设计迷住了。
例如:有一个页面可以被分成两部分,左边和右边。
左边是一些菜单,右边是主要内容。
当用户点击左边的一个菜单时,右边的内容也会发生相应的变化。
然而,并不是所有的内容都具有相同的结构,那么该如何做呢?
假设菜单如下所示:
My group
product01
product02
My information
My post
my reply
modify my information.
那么,如何设计呢?
使用jsp:include /tile?
但是不管用什么,我都要创建这么多的jsp片段?
目前最好的实践是什么?