source: trunk/www/info/news.jsp @ 5426

Last change on this file since 5426 was 5426, checked in by Nicklas Nordborg, 12 years ago

References #1514: Fix character encoding of jsp files

  • Add pageEncoding="UTF-8" to all JSP files.
  • Add @charset="UTF-8"; to all CSS files.
  • Add charset="UTF-8" to all <script> tags

This should at least make Eclipse happy and hopefully allow other editors to automatically select the correct encoding.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1<%-- $Id: news.jsp 5426 2010-09-24 09:18:50Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2005 Nicklas Nordborg
4  Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Gregory Vincic
5
6  This file is part of BASE - BioArray Software Environment.
7  Available at http://base.thep.lu.se/
8
9  BASE is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License
11  as published by the Free Software Foundation; either version 3
12  of the License, or (at your option) any later version.
13
14  BASE is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  GNU General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with BASE. If not, see <http://www.gnu.org/licenses/>.
21  ------------------------------------------------------------------
22
23  This page lists all news in case they are too many to be shown
24  on the fron page.
25
26  @author Nicklas
27  @version 2.0
28--%>
29<%@ page pageEncoding="UTF-8" session="false"
30  import="net.sf.basedb.core.SessionControl"
31  import="net.sf.basedb.core.DbControl"
32  import="net.sf.basedb.core.News"
33  import="net.sf.basedb.core.ItemQuery"
34  import="net.sf.basedb.core.ItemResultList"
35  import="net.sf.basedb.core.query.Orders"
36  import="net.sf.basedb.core.query.Hql"
37  import="net.sf.basedb.core.query.Expressions"
38  import="net.sf.basedb.clients.web.Base"
39  import="net.sf.basedb.clients.web.util.HTML"
40  import="net.sf.basedb.util.Values"
41  import="net.sf.basedb.util.formatter.Formatter"
42  import="net.sf.basedb.clients.web.formatter.FormatterFactory"
43  import="java.util.Date"
44%>
45<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
46<%
47final SessionControl sc = Base.getSessionControl(pageContext, true);
48final String ID = sc.getId();
49final DbControl dc = sc.newDbControl();
50final String root = request.getContextPath()+"/";
51ItemResultList<News> news = null;
52try
53{
54  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
55  %>
56  <base:page type="default" title="">
57  <base:head styles="login.css">
58  </base:head>
59  <base:body>
60   
61    <table border=0 cellspacing=5 cellpadding=0 width="80%" align="center">
62    <tr><td><base:icon image="goback.gif" /><a href="<%=root%>/main.jsp?ID=<%=ID%>">Back to login</a></td></tr>
63    <tr>
64    <td>
65      <h3>News and announcements</h3>
66      <div id="news" class="news">
67      <%
68      ItemQuery<News> query = News.getQuery();
69      query.order(Orders.desc(Hql.property("newsDate")));
70      query.order(Orders.desc(Hql.property("id")));
71      query.setCacheResult(true);
72      news = query.list(dc);
73      for (News n : news)
74      {
75        %>
76        <div class="item">
77          <span class="date"><%=dateFormatter.format(n.getNewsDate())%></span>
78          <span class="headline"><%=HTML.encodeTags(n.getName())%></span><br>
79          <span class="text"><%=Values.getString(n.getDescription())%></span>
80        </div>
81        <%
82      }
83      %>
84      </div>
85    </td>
86    </tr>
87    <tr><td><base:icon image="left_arrow.gif" /><a href="<%=root%>/main.jsp?ID=<%=ID%>">Back to login</a></td></tr>
88    </table>
89  </base:body>
90  </base:page>
91  <%
92}
93finally
94{
95  if (dc != null) dc.close();
96}
97%>
98
Note: See TracBrowser for help on using the repository browser.