<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[安道生練功房 - Latest posts for "newbiejforum"]]></title>
		<link>https://forum.andowson.com/posts/listByUser/97</link>
		<description><![CDATA[Latest posts for "newbiejforum"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>[網頁程式設計 Web Development] Re:Help me level menu ...</title>
				<description><![CDATA[ Wow, thank you very much andowson <img src="https://forum.andowson.com/images/smilies/499fd50bc713bfcdf2ab5a23c00c2d62.gif" alt="smilie">]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/574/1212</guid>
				<link>https://forum.andowson.com/posts/preList/574/1212</link>
				<pubDate><![CDATA[Mon, 5 Mar 2012 15:50:59]]> GMT</pubDate>
				<author><![CDATA[ newbiejforum]]></author>
			</item>
			<item>
				<title>[網頁程式設計 Web Development] Re:Help me level menu ...</title>
				<description><![CDATA[ <br>
<br>
<br>
I tried .... and it does not run <img src="https://forum.andowson.com/images/smilies/9d71f0541cff0a302a0309c5079e8dee.gif" alt="smilie">
<br>
<br>
<br>]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/574/1210</guid>
				<link>https://forum.andowson.com/posts/preList/574/1210</link>
				<pubDate><![CDATA[Sat, 3 Mar 2012 14:59:38]]> GMT</pubDate>
				<author><![CDATA[ newbiejforum]]></author>
			</item>
			<item>
				<title>[網頁程式設計 Web Development] Help me level menu ...</title>
				<description><![CDATA[ I have problem, this is my code : 
<br>
<br>
file GenericCategories.java 
<br>
<pre class="line-numbers"><code class="language-java match-braces">package com.menu.dao.generic;<br><br>import java.sql.Connection;<br>import java.sql.PreparedStatement;<br>import java.sql.ResultSet;<br>import java.util.ArrayList;<br>import java.util.List;<br><br>import com.menu.entities.Categories;<br>import com.menu.entities.Menu;<br>import com.menu.includes.DBConnect;<br><br>public class GenericCategories {<br>		<br>	public List SelectAllC() throws Exception {		<br>		List sac = new ArrayList();<br>		<br>		PreparedStatement ps = null;	<br>		ResultSet rs = null;<br>		PreparedStatement ps1 = null;	<br>		ResultSet rs1 = null;<br>		DBConnect db = new DBConnect();<br>		Connection con = db.getConnect();<br>		<br>		String sql = "SELECT id, category FROM categories";<br>		<br>		try {<br>			ps = con.prepareStatement(sql);<br>			rs = ps.executeQuery();		<br>			<br>			while(rs.next()){	<br>				Categories c = new Categories();<br>				<br>				c.setCategory(rs.getString("category"));<br>				c.setId(rs.getInt("id"));<br>				<br>				String sql2 = "SELECT m.id, m.menu FROM menu m, categories c WHERE c.id = m.cat AND m.cat = ?";<br>				ps1 = con.prepareStatement(sql2);<br>				ps1.setInt(1, c.getId());<br>				rs1 = ps1.executeQuery();				<br>				<br>				while(rs1.next()) {<br>					Menu m = new Menu();			<br>					<br>					m.setMenuid(rs1.getInt("id"));<br>					m.setMenu(rs1.getString("menu"));					<br>					<br>                ///// //     How can i code here ... ////////////<br>					<br>				}				<br>				<br>				sac.add(c);<br>			}					<br>		} finally {<br>			<br>		}		<br>		<br>		return sac;<br>	}	<br>	<br>}<br></code></pre>
<br>
<br>
and my Categories.java: 
<br>
<br>
<pre class="line-numbers"><code class="language-java match-braces">package com.menu.entities;<br><br><br><br>public class Categories {<br>	private int id;<br>	private String category;	<br>	<br>	<br>	<br>	public int getId() {<br>		return id;<br>	}<br>	<br>	public void setId(int id) {<br>		this.id = id;<br>	}<br>	<br>	public String getCategory() {<br>		return category;		<br>	}<br>	<br>	public void setCategory(String category) {<br>		this.category = category;<br>	}	<br>}<br></code></pre>
<br>
<br>
file Menu.java 
<br>
<pre class="line-numbers"><code class="language-java match-braces">package com.menu.entities;<br><br>public class Menu {<br>	private int menuId;<br>	private String menu;<br>	<br>	public int getMenuid() {<br>		return this.menuId;<br>	}<br>	<br>	public void setMenuid(int menuId) {<br>		this.menuId = menuId;<br>	}<br>	<br>	public String getMenu() {<br>		return this.menu;<br>	}<br>	<br>	public void setMenu(String menu) {<br>		this.menu = menu;<br>	}<br>}<br></code></pre>
<br>
and index.java 
<br>
<pre class="line-numbers"><code class="language-java match-braces">package com.menu;<br><br>import java.io.*;<br>import java.util.*;<br><br>import freemarker.template.*;<br><br>import javax.servlet.*;<br>import javax.servlet.http.*;<br><br>import com.menu.dao.generic.GenericCategories;<br>import com.menu.dao.generic.GenericMenu;<br><br>public class Index extends HttpServlet {<br>private Configuration cfg;<br>	<br>	public void init() {<br>		cfg = new Configuration();<br>		cfg.setServletContextForTemplateLoading(getServletContext(), "templates");<br>		cfg.setObjectWrapper(ObjectWrapper.BEANS_WRAPPER);<br>	}	<br>	<br>	public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {<br>		res.setContentType("text/html");<br>		res.setCharacterEncoding("utf-8");<br>		Template t = cfg.getTemplate("demo.html");<br>		<br>		Map root = new HashMap();		<br>		<br>		GenericCategories gc = new GenericCategories();<br>		GenericMenu gm = new GenericMenu();	<br>		<br>		<br>		try {			<br>			root.put("allCategories", gc.SelectAllC());<br>		} catch (Exception e1) {<br>			System.out.println(e1);<br>		}		<br>		<br>		Writer out = res.getWriter();<br>		try {<br>			t.process(root, out);<br>		} catch (TemplateException te) {<br>			te.printStackTrace();<br>		}<br>	}<br>}<br></code></pre>
<br>
<br>
<br>
I want list categories two level, i need you help, thank you very much ... 
<br>
<br>
<br>
<br>]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/574/1208</guid>
				<link>https://forum.andowson.com/posts/preList/574/1208</link>
				<pubDate><![CDATA[Tue, 28 Feb 2012 19:10:19]]> GMT</pubDate>
				<author><![CDATA[ newbiejforum]]></author>
			</item>
			<item>
				<title>[網頁程式設計 Web Development] have problem menu and sub menu in java servlet + freemarker ...</title>
				<description><![CDATA[ Hi, i am learning java servlet + freemarker, and i have a problem like this subject, 
<br>
This is my source, i want to show all categories in browser like file categories.txt in file testmenu.zip, how can i do next step?? my english is bad <img src="https://forum.andowson.com/images/smilies/499fd50bc713bfcdf2ab5a23c00c2d62.gif" alt="smilie"> , i need your help ... 
<br>
<br>
this is my testmenu.zip 
<br>
<br>
http://www.mediafire.com/?qvq9r3wjg27dhch 
<br>
<br>
thank you very much <img src="https://forum.andowson.com/images/smilies/499fd50bc713bfcdf2ab5a23c00c2d62.gif" alt="smilie">
<br>
<br>]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/573/1207</guid>
				<link>https://forum.andowson.com/posts/preList/573/1207</link>
				<pubDate><![CDATA[Fri, 3 Feb 2012 00:23:49]]> GMT</pubDate>
				<author><![CDATA[ newbiejforum]]></author>
			</item>
			<item>
				<title>[JForum中文社群 JForum Chinese Users Community] Search user in user/list...</title>
				<description><![CDATA[ In file generic_queries.sql:
<br>
<br>
<pre class="line-numbers"><code class="language-java match-braces">UserModel.findByName = SELECT user_id, username, user_email, user_regdate, user_posts, deleted \<br>        FROM jforum_users \<br>        WHERE UPPER(u.username) \<br>        LIKE UPPER(?)</code></pre>
<br>
<br>
In file GenericUserDAO:
<br>
<br>
<pre class="line-numbers"><code class="language-java match-braces">public List findByName(String input, boolean exactMatch)<br>	{<br>		List namesList = new ArrayList();<br><br>		PreparedStatement p = null;<br>		ResultSet rs = null;<br>		try {<br>			p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.findByName"));<br>			p.setString(1, exactMatch ? input : "%" + input + "%");<br><br>			rs = p.executeQuery();<br>			while (rs.next()) {<br>				User u = new User();<br><br>                              u.setId(rs.getInt("user_id"));<br>                              u.setUsername(rs.getString("username"));<br>                              u.setColor(rs.getString("group_color"));<br>                              u.setEmail(rs.getString("user_email"));<br>                              u.setRegistrationDate(new Date(rs.getTimestamp("user_regdate").getTime()));<br>                              u.setTotalPosts(rs.getInt("user_posts"));<br>                              u.setDeleted(rs.getInt("deleted"));<br><br>				namesList.add(u);<br>			}<br>			return namesList;<br>		}<br>		catch (SQLException e) {<br>			throw new DatabaseException(e);<br>		}<br>		finally {<br>			DbUtils.close(rs, p);<br>		}<br>	}</code></pre>
<br>
<br>
In file view/forum/UserAction:
<br>
<pre class="line-numbers"><code class="language-java match-braces">private void commonData()<br>	{			<br>		this.setTemplateName(TemplateKeys.USER_LIST);		<br>	}<br>        <br>public void search()<br>	{<br>		String search = this.request.getParameter("username");		<br>		<br>		if (search != null &amp;&amp; !"".equals(search)) {<br>            List users;<br>			users = DataAccessDriver.getInstance().newUserDAO().findByName(search, false);<br>			<br>			this.commonData();<br>			<br>			this.context.put("users", users);<br>			this.context.put("search", search);<br>		}		<br>		else {<br>			this.list();<br>		}<br>	}</code></pre>
<br>
<br>
In file user_list.htm (not in admin/user_list.htm):
<br>
<pre class="line-numbers"><code class="language-java match-braces">&lt;table width="100%"&gt;        <br>        &lt;tr&gt;<br>		&lt;td class="gen" align="center"&gt;<br>			&lt;form id="formusersearch" action="${JForumContext.encodeURL("/jforum")}" accept-charset="${encoding}" method="post"&gt;<br>			&lt;span class="gensmall"&gt;<br>			${I18n.getMessage("User.searchByUsername")}: <br>			&lt;input type="hidden" name="action" value="search" /&gt;<br>			&lt;input type="hidden" name="module" value="${moduleName}" /&gt;<br><br>			&lt;input type="text" name="username" value="${search?default("")}" /&gt;<br><br>			&lt;input type="submit" value="${I18n.getMessage("ForumBase.search")}" class="mainoption"/&gt;<br>			&lt;/form&gt;<br>		&lt;/td&gt;<br>	&lt;/tr&gt;<br>        <br>&lt;/table&gt;</code></pre>]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/538/1065</guid>
				<link>https://forum.andowson.com/posts/preList/538/1065</link>
				<pubDate><![CDATA[Thu, 16 Jun 2011 15:00:18]]> GMT</pubDate>
				<author><![CDATA[ newbiejforum]]></author>
			</item>
			<item>
				<title>[JForum中文社群 JForum Chinese Users Community] 回覆:In forums/list.., i want show last post title, how can i do ??</title>
				<description><![CDATA[ Thank you very much, andowson !! <img src="https://forum.andowson.com/images/smilies/499fd50bc713bfcdf2ab5a23c00c2d62.gif" alt="smilie">]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/480/1000</guid>
				<link>https://forum.andowson.com/posts/preList/480/1000</link>
				<pubDate><![CDATA[Tue, 26 Apr 2011 20:07:27]]> GMT</pubDate>
				<author><![CDATA[ newbiejforum]]></author>
			</item>
			<item>
				<title>[JForum中文社群 JForum Chinese Users Community] 回覆:In forums/list.., i want show last post title, how can i do ??</title>
				<description><![CDATA[ <blockquote>
 <div>
  <cite>newbiejforum wrote:</cite>Hi andowson,
  <br>
  When i add this line in the PostAction.java, and compline to class, i get an error:
  <br>
  <br>
  <blockquote class="uncited">
   <div>
    PostAction.java:1052: cannot find symbol
    <br>
    symbol : variable StringUtils
    <br>
    location: class net.jforum.view.forum.PostAction
    <br>
     if (StringUtils.isBlank(p.getSubject())) {
    <br>
     ^
    <br>
    PostAction.java:1437: cannot access javax.servlet.ServletOutputStream
    <br>
    class file for javax.servlet.ServletOutputStream not found
    <br>
     os = response.getOutputStream();
    <br>
   </div>
  </blockquote>
  <br>
  <br>
  I find in WEB-INF\lib ( all .jar file), but this file javax/servlet/ServletOutpitStream.class not found,
  <br>
  How can i do next step ??
  <br>
  thank you very much !!
  <br>
 </div>
</blockquote>
<br>
<br>
<br>
It is not show new last post title too <img src="https://forum.andowson.com/images/smilies/9d71f0541cff0a302a0309c5079e8dee.gif" alt="smilie">]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/480/998</guid>
				<link>https://forum.andowson.com/posts/preList/480/998</link>
				<pubDate><![CDATA[Tue, 26 Apr 2011 09:11:44]]> GMT</pubDate>
				<author><![CDATA[ newbiejforum]]></author>
			</item>
			<item>
				<title>[JForum中文社群 JForum Chinese Users Community] 回覆:In forums/list.., i want show last post title, how can i do ??</title>
				<description><![CDATA[ Hi andowson, 
<br>
When i add this line in the PostAction.java, and compline to class, i get an error: 
<br>
<br>
<blockquote class="uncited">
 <div>
  PostAction.java:1052: cannot find symbol 
  <br>
  symbol : variable StringUtils 
  <br>
  location: class net.jforum.view.forum.PostAction 
  <br>
   if (StringUtils.isBlank(p.getSubject())) { 
  <br>
   ^ 
  <br>
  PostAction.java:1437: cannot access javax.servlet.ServletOutputStream 
  <br>
  class file for javax.servlet.ServletOutputStream not found 
  <br>
   os = response.getOutputStream(); 
  <br>
 </div>
</blockquote>
<br>
<br>
I find in WEB-INF\lib ( all .jar file), but this file javax/servlet/ServletOutpitStream.class not found, 
<br>
How can i do next step ?? 
<br>
thank you very much !! 
<br>]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/480/996</guid>
				<link>https://forum.andowson.com/posts/preList/480/996</link>
				<pubDate><![CDATA[Mon, 25 Apr 2011 16:23:16]]> GMT</pubDate>
				<author><![CDATA[ newbiejforum]]></author>
			</item>
			<item>
				<title>[JForum中文社群 JForum Chinese Users Community] Help group name in Jforum</title>
				<description><![CDATA[ Hello everybody, i want to show the groupname in the posts/list..., Ex image 
<br>
<br>
http://www.flickr.com/photos/56316793@N03/5652960036 
<br>
<br>
How can i do that??? 
<br>
<br>
thank you very much !!!]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/481/995</guid>
				<link>https://forum.andowson.com/posts/preList/481/995</link>
				<pubDate><![CDATA[Mon, 25 Apr 2011 15:30:19]]> GMT</pubDate>
				<author><![CDATA[ newbiejforum]]></author>
			</item>
			<item>
				<title>[JForum中文社群 JForum Chinese Users Community] In forums/list.., i want show last post title, how can i do ??</title>
				<description><![CDATA[ my english is bad 
<br>
Hi andowson and everybody, i like jforum, i using jforum 2.1.9, but this version not show last post title in .../forums/list.. , and I did the following: 
<br>
<br>
In file \WEB-INF\config\database\generic\generic_queries.sql, i edit 
<br>
<blockquote class="uncited">
 <div>
  ForumModel.lastPostInfo = SELECT post_time, p.topic_id, t.topic_replies, post_id, u.user_id, username, <font color="red">t.topic_title</font> \ 
  <br>
   FROM jforum_posts p, jforum_users u, jforum_topics t, jforum_forums f \ 
  <br>
   WHERE t.forum_id = f.forum_id \ 
  <br>
   AND t.topic_id = p.topic_id \ 
  <br>
   AND f.forum_last_post_id = t.topic_last_post_id \ 
  <br>
   AND t.topic_last_post_id = p.post_id \ 
  <br>
   AND p.forum_id = ? \ 
  <br>
   AND p.user_id = u.user_id \ 
  <br>
   AND p.need_moderate = 0
 </div>
</blockquote>
<br>
<br>
In file \net\jforum\dao\generic\GenericForumDAO.java, i edit it and compile to class file 
<br>
<br>
<blockquote class="uncited">
 <div>
  if (rs.next()) { 
  <br>
   lpi.setUsername(rs.getString("username")); 
  <br>
   lpi.setUserId(rs.getInt("user_id")); 
  <br>
  <br>
   final SimpleDateFormat sdf = new SimpleDateFormat(SystemGlobals.getValue(ConfigKeys.DATE_TIME_FORMAT), Locale.getDefault()); 
  <br>
   lpi.setPostDate(sdf.format(rs.getTimestamp("post_time"))); 
  <br>
   lpi.setPostId(rs.getInt("post_id")); 
  <br>
   lpi.setTopicId(rs.getInt("topic_id")); 
  <br>
   lpi.setPostTimeMillis(rs.getTimestamp("post_time").getTime()); 
  <br>
   lpi.setTopicReplies(rs.getInt("topic_replies")); 
  <br><font color="red">lpi.setTitle(rs.getString("topic_title"));</font>
  <br>
   lpi.setHasInfo(true); 
  <br>
  <br>
  <br>
   // Check if the topic is consistent 
  <br>
   TopicDAO topicDao = DataAccessDriver.getInstance().newTopicDAO(); 
  <br>
   Topic topic = topicDao.selectById(lpi.getTopicId()); 
  <br>
  <br>
   if (topic.getId() == 0) { 
  <br>
   // Hm, that's not good. Try to fix it 
  <br>
   topicDao.fixFirstLastPostId(lpi.getTopicId()); 
  <br>
   } 
  <br>
  <br>
   tryFix = false; 
  <br>
   }
 </div>
</blockquote>
<br>
<br>
In file \net\jforum\entities\LastPostInfo.java, i edit it and compile to class file: 
<br>
<br>
<blockquote class="uncited">
 <div>
  /** 
  <br>
   * @return Returns the title. 
  <br>
   */ 
  <br>
   public String getTitle() { 
  <br>
   return this.topicTitle; 
  <br>
   } 
  <br>
  <br>
   /** 
  <br>
   * @param title The title to set. 
  <br>
   */ 
  <br>
   public void setTitle(final String title) { 
  <br>
   this.topicTitle = title; 
  <br>
   }
 </div>
</blockquote>
<br>
<br>
In the forum_list.htm, : 
<br>
<br>
<blockquote class="uncited">
 <div>
  &lt;#assign url = JForumContext.encodeURL("/posts/list/${startPage}${lpi.topicId}") + "#p" + lpi.postId/&gt; 
  <br>
   &lt;a href="${url}" class="last_title"&gt;&lt;img src="${contextPath}/templates/${templateName}/images/icon_latest_reply.gif" border="0" alt="[Latest Reply]" /&gt;<font color="red">${lpi.title}</font>&lt;/a&gt;
 </div>
</blockquote>
<br>
<br>
I restart tomcat, and it show title <img src="https://forum.andowson.com/images/smilies/283a16da79f3aa23fe1025c96295f04f.gif" alt="smilie"> , but, when i post a new topic, it show old title <img src="https://forum.andowson.com/images/smilies/9d71f0541cff0a302a0309c5079e8dee.gif" alt="smilie">(, when i restart tomcat, it show new title, 
<br>
<br>
I need your help, thank you very much :"&gt;]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/480/993</guid>
				<link>https://forum.andowson.com/posts/preList/480/993</link>
				<pubDate><![CDATA[Sun, 24 Apr 2011 11:53:41]]> GMT</pubDate>
				<author><![CDATA[ newbiejforum]]></author>
			</item>
	</channel>
</rss>