使用struts jsp从数据库中检索数据 [英] Retrieve data from Database using struts jsp

查看:145
本文介绍了使用struts jsp从数据库中检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Struts和JSP的新手...我已经在下面编写了5个小时的代码了......我google了很多但是得不到多少帮助所以最后我在这里..希望得到我的问题解决了。请告诉我一些错误的地方?


我只想从emp_mstr表中检索数据并使用我的JSP文件显示它...


表emp_mstr如下: -

I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn''t get much help so finally I am here.. Hoping of getting my problem solved. Please give me some idea where I am going wrong ??

I just want to retrieve data from my emp_mstr table and display it using my JSP file...

The table emp_mstr is as follows :-

展开 | 选择 | Wrap | 行号

推荐答案

好的,好像你是新手,


嘿哥们你已经完成了从数据库中检索数据的代码

checkout EmployeeDAO.java


点击: JSP数据库连接代码


希望它能运行
Okay, seems that you are newbie,

hey buddy you''ve already done the code for retrieving the data from database
checkout EmployeeDAO.java

Click: JSP Database Connectivity Code

hope it works


是的,我知道要检索的代码就在那个DAO类中..

但是如何显示它?我的意思是我使用了< bean:write>在我的JSP文件中标记,但它没有显示任何值。


当我已经为我创建了一个单独的类时,如何在我的JSP中再次编写用于数据库连接和数据检索的代码目的即EmployeeDAO.java


为什么不显示? < bean:write>是否存在问题?标签?


当我将鼠标悬停在< bean:write>上时标签

它说未知标签bean:写入


它有什么问题?
Yes I know the code to retrieve is there in that DAO class..
But how do I display it ?? I mean I have used the <bean:write > tag in my JSP file but its not displaying any value.

How can I write the code for DB connection and data retrieval again in my JSP when I have already made a separate class for that purpose i.e EmployeeDAO.java

Why is it not getting displayed ? Is there some problem with <bean:write > tag ?

Also when I hover mouse on <bean:write> tag
it says "unknown tag bean:write"

Whats wrong with it ?


顶部jsp页面的正上方< html>标签写下面的行: -

At the top of the jsp page, just above the <html> tag write following lines:-

展开 | 选择 | Wrap | 行号


这篇关于使用struts jsp从数据库中检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆