没有人能解决一下吗?

hzxsgk 2007-04-26 12:16:17
各位兄弟,希望大家来帮帮小弟,我有一个jsp用得是struts的,我不太熟悉这技术,有两个问题想问一个,一个是
<td align="center" valign="top"> <c:import url="/info.do?method=getNews"/> </td>
上面那个引入的是一个显示新闻头的文件,首先想先问一下那个info.do我知道好像是struts里面的做action的,但是因为没有接触过,我不知道我具体去哪里查这个.do是被原先哪个文件做映射的,即他的实际页面jsp文件在哪里,这样可以方便我看。
第二个是想问一下,我现在想把他那些从数据库里面读出来的头文件实现滚动效果,我也没有做过这方面的,试了好几种方法都没成功,现请教大家!
我试过,
1. <td align="center" valign="top"><marquee> <c:import url="/info.do?method=getNews"/> </marquee> </td>
这样的是完全不显示。
2.
<marquee><td align="center" valign="top"><marquee> <c:import url="/info.do?method=getNews"/></td> </marquee>
这样不滚动。
3.试想是不是要去那个info具体的所指向的文件里面把读出来的5条做一个数组再实现滚动,但又因为第一个问题,就是根本不知道他指向的文件是哪个。。所以。。。

请高手帮我来看看,谢谢你啊!!!万分感激!在线等!!!
...全文
353 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
hzxsgk 2007-04-26
  • 打赏
  • 举报
回复
下面是在struts-config.xml找到的:
<action
path="/info"
type="com.photo525.webapp.action.InfoAction"
name="infoForm"
parameter="method"
>
</action>
<action
path="/personal/admin/info"
type="com.photo525.webapp.action.InfoAction"
name="infoForm"
parameter="method"
>
hzxsgk 2007-04-26
  • 打赏
  • 举报
回复
<filter>
<filter-name>securityFilter</filter-name>
<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
<init-param>
<param-name>targetClass</param-name>
<param-value>org.acegisecurity.util.FilterChainProxy</param-value>
</init-param>
</filter>
<filter>
<filter-name>cacheFilter</filter-name>
<filter-class>com.opensymphony.oscache.web.filter.CacheFilter</filter-class>
</filter>
<filter>
<filter-name>clickstreamFilter</filter-name>
<filter-class>com.opensymphony.clickstream.ClickstreamFilter</filter-class>
</filter>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>gbk</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter>
<filter-name>rewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter>
<filter-name>exportFilter</filter-name>
<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
</filter>

<filter>
<filter-name>compressionFilter</filter-name>
<display-name>Compression Filter</display-name>
<filter-class>com.photo525.webapp.filter.GZIPFilter</filter-class>
</filter>

<!-- 编码FILTER -->

<!-- filter>

<filter-name>Character Encoding</filter-name>

<filter-class>com.photo525.webapp.filter.CharacterFilter</filter-class>

</filter -->



<!-- filter-mapping>

<filter-name>Character Encoding</filter-name>

<url-pattern>*.do</url-pattern>

</filter-mapping -->

<filter-mapping>
<filter-name>securityFilter</filter-name>
<url-pattern>/j_security_check</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>securityFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>securityFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

<!-- Commented out for 2 reasons: 1) it's a pain when developing JSPs, and
2) it causes the Signup webtest to fail -->
<!--filter-mapping>
<filter-name>cacheFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping-->
<!-- The 'hibernateFilter', a.k.a. Spring's OpenSessionInViewFilter
guarantees one session per request. Performance seems to be the
same if it's enabled or disabled. -->
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>clickstreamFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>exportFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>compressionFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<!--filter-mapping>
<filter-name>rewriteFilter</filter-name>
<url-pattern>/*</url-pattern-->
<!-- These are needed by Tomcat 5 for forwards -->
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<!--/filter-mapping-->
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
<!-- These are needed by Tomcat 5 for forwards -->
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

<listener>
<listener-class>com.opensymphony.clickstream.ClickstreamListener</listener-class>
</listener>
<listener>
<listener-class>net.sf.navigator.menu.MenuContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>

<listener>
<listener-class>com.photo525.webapp.listener.StartupListener</listener-class>
</listener>
<listener>
<listener-class>com.photo525.webapp.listener.UserCounterListener</listener-class>
</listener>

<!-- Standard Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>

<!-- Front Controller Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

<session-config>
<session-timeout>10</session-timeout>
</session-config>

<!--
To specify mime mappings, create a file named mime-mappings.xml, put it in your project's mergedir.
Organize mime-mappings.xml following this DTD slice:

<!ELEMENT mime-mapping (extension, mime-type)>
-->

<welcome-file-list>
<welcome-file>default.jsp</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>

<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>400</error-code>
<location>/index.do</location>
</error-page>
<error-page>
<error-code>403</error-code>
<location>/403.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>

<taglib>
<taglib-uri>/WEB-INF/photo525.tld</taglib-uri>
<taglib-location>/WEB-INF/photo525.tld</taglib-location>
</taglib>

<taglib>

<taglib-uri>http://ubb.libo.com/taglib</taglib-uri>

<taglib-location>/WEB-INF/ubb.tld</taglib-location>

</taglib>
<!-- 纠正resin的el -->

<jsp-config>

<jsp-property-group>

<url-pattern>*.jsp</url-pattern>

<el-ignored>false</el-ignored>

</jsp-property-group>

</jsp-config>

</web-app>

这是web.xml 因内容太多删除了一部分上面的!
dreamover 2007-04-26
  • 打赏
  • 举报
回复
return new ActionForward("/WEB-INF/pages/news.jsp");

<td align="center" valign="top"><marquee width="100" height="200" direction="up"> <c:import url="/info.do?method=getNews"/> </marquee> </td>

marquee里面属性写好
hzxsgk 2007-04-26
  • 打赏
  • 举报
回复
public ActionForward detail(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
InfoManager mgr = (InfoManager) getBean("infoManager");

Integer icid = 0;
try {
icid=Integer.parseInt(request.getParameter("icid"));
} catch (NumberFormatException e) {
e.printStackTrace();
}
DisplayTagHelper helper = DisplayTagHelper.parseRequest("ilist",pageSize,request);

List templates = mgr.getInfos(helper.getStartRow(), pageSize, helper.getSortRow(),helper.getOrder(),icid);
request.setAttribute("list", templates);

int totals = mgr.getInfosCount(icid);
request.setAttribute("totals", totals);
request.setAttribute("pageSize", pageSize);

InfoCategoryManager icm = (InfoCategoryManager) getBean("infoCategoryManager");
InfoCategory ic = icm.getInfoCategory(icid);
request.setAttribute("ic",ic);

return new ActionForward("/detailInfo.jsp");
}
public ActionForward list(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
InfoManager mgr = (InfoManager) getBean("infoManager");

Integer icid = 0;
try {
icid=Integer.parseInt(request.getParameter("icid"));
} catch (NumberFormatException e) {
e.printStackTrace();
}

DisplayTagHelper helper = DisplayTagHelper.parseRequest("ilist",pageSize,request);

List templates = mgr.getInfos(helper.getStartRow(), pageSize, helper.getSortRow(),helper.getOrder(),icid);
request.setAttribute("list", templates);

int totals = mgr.getInfosCount(icid);
request.setAttribute("totals", totals);
request.setAttribute("pageSize", pageSize);

InfoCategoryManager icm = (InfoCategoryManager) getBean("infoCategoryManager");
List iclist = icm.getInfoCategorys();
request.setAttribute("iclist",iclist);

return new ActionForward("/personal/admin/ilist.jsp");
}

public ActionForward search(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("Entering 'search' method");
}

InfoForm infoForm = (InfoForm) form;

// Exceptions are caught by ActionExceptionHandler
InfoManager mgr = (InfoManager) getBean("infoManager");
Info info = (Info) convert(infoForm);
List infos = mgr.getInfos(info);
request.setAttribute(Constants.Info_LIST, infos);

// return a forward to the info list definition
return mapping.findForward("list");
}
/**
* Get populated java bean from form
*/
public Info getInfoFromForm (ActionForm infoForm) throws Exception {
Info info = new Info();
BeanUtils.copyProperties(info, infoForm);
return info;
}

public ActionForward getNews(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception{
ResourceBundle rb = ResourceBundle.getBundle("config");
String key = rb.getString("news");

int icid = 0;
try {
icid=Integer.parseInt(key+"");
} catch (NumberFormatException e) {
e.printStackTrace();
}
InfoManager mgr = (InfoManager) getBean("infoManager");
List list = mgr.getTopInfos(10,icid);
request.setAttribute("news",list);
return new ActionForward("/WEB-INF/pages/news.jsp");
}
}


请问一般这样要怎么样把新闻做成从上到下的滚动呢?
hzxsgk 2007-04-26
  • 打赏
  • 举报
回复
public final class InfoAction extends com.photo525.webapp.action.BaseAction {

public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("Entering 'add' method");
}

Info info = new Info();

InfoForm infoForm = (InfoForm) convert(info);
updateFormBean(mapping, request, infoForm);

return mapping.findForward("edit");
}

public ActionForward cancel(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("Entering 'cancel' method");
}

String next = mapping.findForward("viewInfos").getPath();
return new ActionForward(next, true);

}

public ActionForward delete(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("Entering 'delete' method");
}

InfoForm infoForm = (InfoForm) form;

// Exceptions are caught by ActionExceptionHandler
InfoManager mgr = (InfoManager) getBean("infoManager");
Info info = getInfoFromForm(form);
Integer pkey = info.getId();
mgr.removeInfo(pkey);

ActionForward af = new ActionForward("/personal/admin/info.do?method=list&icid="+request.getParameter("icid"));
af.setRedirect(true);
return af;
}
public ActionForward getInfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
InfoForm infoForm = (InfoForm) form;
InfoManager mgr = (InfoManager) getBean("infoManager");

Info info = getInfoFromForm(form);
Integer pkey = info.getId();
info = mgr.getInfo(pkey);
if(info==null){
ActionForward af = new ActionForward("/personal/admin/info.do?method=list&icid="+request.getParameter("icid"));
af.setRedirect(true);
return af;
}
request.setAttribute("info",info);

return new ActionForward("/personal/admin/modifyInfo.jsp");
}
public ActionForward show(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
InfoForm infoForm = (InfoForm) form;
InfoManager mgr = (InfoManager) getBean("infoManager");

Info info = getInfoFromForm(form);
Integer pkey = info.getId();
info = mgr.getInfo(pkey);
if(info==null){
ActionForward af = new ActionForward("/index.do");
af.setRedirect(true);
return af;
}
request.setAttribute("info",info);

getInfoTops(request);

return new ActionForward("/showInfo.jsp");
}
public ActionForward edit(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("Entering 'edit' method");
}

InfoForm infoForm = (InfoForm) form;
InfoManager mgr = (InfoManager) getBean("infoManager");
Integer pkey = 0;
try {
pkey = Integer.parseInt(infoForm.getId());
} catch (NumberFormatException e) {
e.printStackTrace();
}

Info info = mgr.getInfo(pkey);
if(info==null){
ActionForward af = new ActionForward("/personal/admin/info.do?method=list&icid="+request.getParameter("icid"));
af.setRedirect(true);
return af;
}
info.setInfo(infoForm.getInfo());
info.setTitle(infoForm.getTitle());
mgr.update(info);
request.setAttribute("msg","更新成功!");
request.setAttribute("info",info);

return new ActionForward("/personal/admin/modifyInfo.jsp");
}

public ActionForward save(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
if (log.isDebugEnabled()) {
log.debug("Entering 'save' method");
}
Info info = new Info();
InfoForm infoForm = (InfoForm) form;

try {
info.setTitle(infoForm.getTitle());
info.setInfo(infoForm.getInfo());
info.setInfocategoryid(new Integer(infoForm.getInfocategoryid()));
info.setCreatetime(new Date());

InfoManager mgr = (InfoManager) getBean("infoManager");

mgr.saveInfo(info);
} catch (DataIntegrityViolationException e) {
}

ActionForward af = new ActionForward("/personal/admin/info.do?method=list&icid="+infoForm.getInfocategoryid());
af.setRedirect(true);
return af;
}
dreamover 2007-04-26
  • 打赏
  • 举报
回复
找jsp
看com.photo525.webapp.action.InfoAction里
hzxsgk 2007-04-26
  • 打赏
  • 举报
回复
大家来帮帮我啊
hzxsgk 2007-04-26
  • 打赏
  • 举报
回复
我还有一个有关java,带些struts的,希望哪位朋友能联系一下,小弟很急,可以有偿服务,不过只能够你吃一餐的钱。因为是我个人出的,哪位朋友觉得行的话,可以联系我一下,上海的可以直接手机13072158083,也可以QQ:303990322 或msn: guokai080@hotmail.com
主要问题是网银接口回到直后,有一个类里面要更新新的金额到数据库里面那个类一直有问题,现在还有些麻烦是,原的java文件不是最新的,光一个class,一时也讲不清楚,希望好心人帮帮我!
jack_von 2007-04-26
  • 打赏
  • 举报
回复
struts-config.xml
里面的<forward/> 呢???
dreamover 2007-04-26
  • 打赏
  • 举报
回复
<marquee width="100" height="200" direction="up" onmouseover="this.stop();" onmouseout="this.start();">
hzxsgk 2007-04-26
  • 打赏
  • 举报
回复
东西能滚起来,有没有js能让他鼠标到那边会停下来啊?不然他一直滚的哦!
likgui 2007-04-26
  • 打赏
  • 举报
回复
关注

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧