---
title: "jstl使下拉列选中"
author: "八岭书生"
date: "2012-04-21T18:37:50Z"
tags: []
categories: ["Web前端"]
slug: "jstl"
draft: false
lastmod: "2012-04-21T18:37:50Z"
id: 1493520
url: "https://liangq.iteye.com/blog/1493520"
---

```
<form action="searchNews.do" method="post">
		本站搜索：
		<input type="text" name="searchParam" style="height:20px" value="<c:out value="${searchParam}" />"/>
		<select name="searchWhich">
			<option value="title" <c:if test="${searchWhich == 'title'}">selected</c:if>  />标题
			<option value="content" <c:if test="${searchWhich == 'content'}">selected</c:if> />内容
		</select>
		<input type="submit" value="搜索" style="height:23px"/>
	</form>
```