求大神帮忙解决javaweb数据存储问题

我写了一个项目,在页面有一个编辑器,我想将编辑器里的内容存到数据库中,然后再从数据库中读取出来,但是存放到数据库是编码正常,取出来就出现乱码,我的页面、数据库和Java编码都是utf-8编码,为什么还要乱码

3个回答

可以试试,URLEncoder ,URLDecoder

写一个 字符编码过滤器

不是那些都设置成utf-8就可以的;
如楼上所说,你需要一个字符编码的过滤器对你取出的内容进行设置编码,这里有你需要的代码:
http://www.jb51.net/article/36341.htm

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
javaweb 小问题求大神帮忙解决下
Deployment is out of date due to changes in the underlying project contents. You'll need to manually 'Redeploy' the project to update the deployed archive.nMissing web.xml deployment descriptor in WEB-INF foldernnmyeclipse2014 tomcat 7.0 n刚安装的时候好好的 几天后就在部署项目时不能部署 大学生初学 请求帮助
javaWeb一些初级问题求大神解决!
隐藏表单 cookie URL地址重写 Session 究竟有什么用与四个作用域有什么区别?
求大神帮忙解决
import java.io.*;rnpublic class Calculator rn // 定义相关变量rn private String sum = null;rn private String qbrc = null;rn private double qbr1 = 1;rn private double qbr2 = 1;rn String abr1;rn String abr2;rn public Calculator()rn rn rn public void sumT()rn /*rn * 接口功能:进行相关的输入和类型转换 rn * 接口输入:空 rn * 接口输出:空 rn */rn tryrn System.out.println("欢迎使用!!!/n此计算器除可以进行数字各种相关运算还可以进行字符串的相加");rn System.out.print("请您输入您的第一次输入:");rn BufferedReader br1 = new BufferedReader(new InputStreamReader(System.in));rn System.out.print("请输入您的第二次输入:");rn BufferedReader br2 = new BufferedReader(new InputStreamReader(System.in));rn System.out.print("请选择符号(+、—、*、/):");rn BufferedReader brc = new BufferedReader(new InputStreamReader(System.in));rn qbrc = brc.toString();rn abr1 = br1.toString();rn abr2 = br2.toString();rn catch(Exception e)rn e.printStackTrace();rn System.err.println("操作有误,请重新操作!!!");rn rn tryrn qbr1 = Double.parseDouble(abr1);rn qbr2 = Double.parseDouble(abr2);rn rn rn catch(Exception e)rn e.printStackTrace();rn System.err.println("***"+abr1+abr2+"***");rn rn /*rn * 接口功能:进行相关运算并输出结果 rn * 接口输入:空 rn * 接口输出:空 rn */rn tryrn if(qbrc=="+")rn double resultOf = qbr1+qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn if(qbrc=="-")rn double resultOf = qbr1-qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn if(qbrc=="*")rn double resultOf = qbr1*qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn if(qbrc=="/")rn double resultOf = qbr1/qbr2;rn System.out.println("第一个数:"+abr1+"\n第二个数:"+abr2+"\n结果为:"+resultOf);rn rn catch(Exception e)rn e.printStackTrace();rn System.err.println("**********\n您的除数不能为零!!!\n**********");rn rn rn rn rn /**rn * @param argsrn */rn public static void main(String[] args) rn Calculator calculator = new Calculator();rn calculator.sumT();rn rnrnrn
求大神帮忙解决!!!
学习到jsp内置对象的时候,发现内置对象调用的都是抽象方法,查看源码也没看见被什么方法给实现,为什么它还可以调用这些方法???(查看源码的时候还发现一个问题:public abstract interface ServletResponse 这是什么???)请哪位大神讲解清楚!!!
求大神帮忙解决异常问题
ERROR: HHH000319: Could not get database metadatarnorg.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))rn at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)rn at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)rn at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)rn at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:141)rn at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)rn at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:219)rn at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:203)rn at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:509)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1799)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)rn at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:242)rn at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:372)rn at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:357)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:589)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)rn at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)rn at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)rn at java.util.concurrent.FutureTask.run(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at java.lang.Thread.run(Unknown Source)rn
算法设计 求大神 帮忙解决
设给出了如下字母表及其相应的频率,试作出其Huffman树和相应的字母的编码:rnrn字母 a b c d e f g rn频数 12 2 4 7 23 14 9 rnrn
求大神帮忙解决一下
[img=https://img-bbs.csdn.net/upload/201408/28/1409228843_418446.png][/img]rn请问这个是什么原因出现的提示:如何让它取消掉?求大神解决,
求大神帮忙解决 SQL
表SC 有字段S#学生ID,Sname 学生姓名,C#学科,Score 分数 取各科成绩排前2的学生信息rn这个该怎么写?rn假设表数据如下rn[img=https://img-bbs.csdn.net/upload/201403/12/1394597616_649990.png][/img]rnrn需要得到如下结果[img=https://img-bbs.csdn.net/upload/201403/12/1394597862_173446.png][/img]
系统问题求大神帮忙解决
windows系统,执行cmd命令窗口闪一下就关闭rn网上有人说执行regedit命令 但是我在执行这个命令的时候也自动关闭了,根本来不及看注册表信息。rn各种方法都试过了,求大神帮忙解决。
急求大神帮忙解决的问题
上一篇的动态规划入门题我引申了几个问题不会解决求大神帮忙 1:如何判断对于给定的硬币的种类对某个特定的值不存在任何一个可以满足的情况 2:如何将所有可能的凑出来的情况都进行保存
求大神帮忙解决字符串分割问题
表中的数据是这样的 rn1.25.26.27.28 rn1.29.32.35rn57.58.59.60.62.63rn57.65.66.67.68rn。。。rn这样的一列数据怎么SELECT出按"."分割的多列如:1 25 26 27 28 这样的数据求大神帮忙,谢谢rn
求大神帮忙解决html+css的问题
[i][b]这是html:[/b][/i]rnrn[color=#FFFF00]rnrnrn rn 无标题文档rn rn rnrnrnrn rn rn 用户名: rn 密 码: rn 验证码: rn rnrn rn rn ENTERENTERrn rnrn 版权所有:青岛丽城时速科技有限公司 CopyRight 2011-2013,All Rights Reserved. rnrnrn[/color]rnrnrn[b][i]这是CSS:[/i][/b]rn[color=#FFFF00].wrapper rn height: 768px;rn width: 1024px;rn margin:auto;rn padding:auto;rn background:url(images/dl.jpg);rn background-repeat:no-repeat;rnrn#top rn width:250px;rn height:107px;rn padding-left:365px;rn padding-top:316px;rn float:left;rn line-height:31px;rn font-size:12px;rn color:#FFF;rnrn#enter rn width:109px;rn height:72px;rn float:right;rn padding-top:350px;rn padding-right:290px;rn color:#FFF;rnrn #enter #div1rn margin-left:1px;rn font:30px tahoma;rn font-family:Arial;rn font-weight:bold;rn rn#enter #div2rn position:relative;rn z-index:1;rn rn#enter #span1rn position:absolute;rn top:1px;rn left:2px;rn z-index:-1;rn color:#cccccc;rn width: 100px;rn height: 52px;rn rn#foot rn width:964px;rn height:403px;rn padding-left: 300px;rn padding-top: 600px;rn font-size:12px;rn left: 316px;rn color:#FFF;rn[/color]rnrn
求大神帮忙解决调用函数问题
我在用java写学生成绩管理系统,现在遇到一个问题,就是事件监听器在传事件的时候没办法传过去,我写了三个java文件,在同一个包里。rn这是主函数的java文件代码:rn[code=java]rnpackage ManageSystem;rnrnpublic class ManageSystem rn public static void main(String[] args) rn MSFrame frame=new MSFrame("学生成绩管理系统");rn frame.setVisible(true);rn rnrn[/code]rnrnrn这是MSFrame的代码,第二个java文件的代码:rn[code=java]rnpackage ManageSystem;rnrnimport java.awt.*;rnimport java.awt.event.*;rnimport javax.swing.*;rnrnclass MSFrame extends JFramern JLabel label,lblUser,lblPassword;rn JTextField tfUser,tfPassword;rn JButton btnLogin;rn public MSFrame(String s)rn //创建系统登陆界面rn super(s);rn label=new JLabel("南京晓庄学院学生成绩管理系统");rn lblUser=new JLabel("User:");rn lblPassword=new JLabel("Password:");rn tfUser=new JTextField(10);rn tfPassword=new JTextField(20);rn btnLogin=new JButton("Login");rn rn Listener bm=new Listener();rn btnLogin.setBackground(new Color(204,204,255));rn rn //布局rn Box box=Box.createVerticalBox(); rn box.add(label);rn Box bh1=Box.createHorizontalBox(); //用户名Userrn bh1.add(lblUser);rn bh1.add(Box.createHorizontalStrut(8));rn bh1.add(tfUser);rn box.add(bh1);rn box.add(Box.createVerticalStrut(8));rn Box bh2=Box.createHorizontalBox(); //密码Passwordrn bh2.add(lblPassword);rn bh2.add(Box.createHorizontalStrut(10));rn bh2.add(tfPassword);rn box.add(bh2);rn box.add(Box.createVerticalStrut(8));rn box.add(btnLogin);rn box.add(Box.createVerticalStrut(8));rn rn this.add(box);rn this.setBounds(250,250,480,300);rn this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn rn rn btnLogin.addActionListener(bm);rn rn rnrn[/code]rnrnrn这是事件监听器的代码,第三个java文件的代码:rn[code=java]rnpackage ManageSystem;rnrnimport java.awt.event.*;rnrnpublic class Listener implements ActionListenerrn rn @Overridern public void actionPerformed(ActionEvent e) rn String User="iamthemanager";rn String Password="iamthemanager";rn String getUser=bm.tfUser.getText();rn rnrn[/code]rnrnrn问题在这:btnLogin.addActionListener(bm);rnbm这个变量传到事件监听器的时候,就是到这句话“String getUser=bm.tfUser.getText();”的时候,说无法解析bm,我没办法从文本中得到文本框的内容,求详细的解决办法,不要太简短,小弟理解能力比较差。谢谢大神了
求大神帮忙解决 ,找不到符号问题
[img=https://img-bbs.csdn.net/upload/201707/17/1500262020_165637.png][/img]rn变量GROUP_OPERATION_CREATE是GroupNotificationMessage类里边定义的rnGroupNotificationMessage是Rong_IMLib.jar里的文件,rn包名也没错rn而且变量GROUP_OPERATION_CREATE和GroupNotificationMessage都能点进去,rn定位的也是.jar包里的文件rnrn问题可能很简单,但是我是初学者,懵逼了一上午了,求大神们帮忙解决rn先谢过了
求大神 帮忙解决下这个问题
[img=https://img-bbs.csdn.net/upload/201703/06/1488790756_170912.jpg][/img]rnrn地图不能完整显示,只能显示文字怎么解决???
求大神帮忙解决这个问题
[img=https://img-bbs.csdn.net/upload/201707/17/1500268010_918862.png][/img]
绝对定位和浮动的问题,求大神帮忙解决
[code=HTML]rn rnrn rn rn 快运单打印rn rn 泉汇来rn 美的小家电rn rn rn 淘宝订单拣货rn 淘宝订单发货rn rn 泉汇来rn 美的小家电rn rn rn 销售商品统计rn rn rnrn[/code]rn这段代码运行时,如果页面很长,超出屏幕长度的话,滚动页面时整个div中的东西都跟着滚动,而且鼠标悬浮时div内容会彻底消失,我知道css没写好,对齐的原因,但是改不过来,求大神帮忙。
求大神帮忙解决一下移植问题
我们公司有个收费系统是在Win98系统中使用,用的是ACCESS数据库(因为公司没有续费维护和软件公司倒闭...多年来一直未升级系统)。rn 最近我把那个系统放到了虚拟机中,虚拟机和原来那台计算机中安装的软件一样,都是office97和VF6.0。用收费系统的其他功能都没问题,但是只要是使用日历控件的页面就会出问题。 rn rn 提示“这个对象不包含OLE自动对象day,您试图运行一个Visual Basic过程为对象设置属性或方法的过程。但是使用组件设置OLE自动对象的属性或方法是无效的。”rn rn 宏里面的内容是“[Forms]![f203_setdate]![monthselector].[day]<1 或 [Forms]![f203_setdate]![monthselector].[day]>31”
求真正的大神 帮忙解决Session问题
我想实现在C#中验证PHP中的登录 rn怎么能获取到php的Session呢。rnrn如果有其他方法可以在C#中 验证php登录 请详细讲解,Cookie 还是别的都行rnrnrn真心求各种大神。 别跟我来理论知识 来代码
求JAVA大神帮忙解决下这个问题
鄙人做了个坦克大战的小游戏,相信很多大神们都做过,但是鄙人的炮筒就是显示不出来...求好心人指点,本人学生新手,就这点分了,全拿出来了。rn1,目前共三个class文件,分别为TankClient,Tank,Missile....rn2,疑问所在:我的drawLine()画不出直线。。。rn3,疑问来源: case D: rnSystem.out.println("炮筒方向开始调用--下!"); rn g.drawLine(x+Tank.TKLENGTH/2, y+Tank.TKWIDTH/2, x+Tank.TKLENGTH/2,y+Tank.TKWIDTH ); //就是画不出来! rnSystem.out.println("炮筒方向调用结束--下!");rn3.11简要说明:dir坦克当前方向。PTdir炮筒当前方向。fire()开火,setlocation()调整当前方向。命名做到见名知意。 rnrn4,原先的3个文件的代码:rn ①TankClient类:rnimport java.awt.*;rnimport java.awt.event.*;rnrnpublic class TankClient extends Frame rn rn Tank mytank=new Tank(50,50,this);rn Missile mis=null;rn rn public void paint(Graphics g) rn mytank.drawTank(g);rn if(mis!=null) mis.drawMissile(g);rn rn rn rn public void launchFrame()rn this.setLocation(40, 30);rn this.setSize(800, 600);rn this.setVisible(true);rn this.setResizable(false);rn this.setBackground(Color.green);rn this.addWindowListener(new WindowAdapter()rn rn public void windowClosing(WindowEvent e) rn System.exit(0);rn rn ); rn this.addKeyListener(new KeyMoniter());rn new Thread(new PaintThread()).start();rn rn rn rn public static void main(String[] args) rn TankClient tc =new TankClient();rn tc.launchFrame(); rn rn rn rn private class PaintThread implements Runnablern rn public void run() rn rn while(true)rn repaint();rn try rn Thread.sleep(35);rn catch (InterruptedException e) rn rn e.printStackTrace();rn rn rn rn rn rn rn private class KeyMoniter extends KeyAdapter rn rnrn public void keyPressed(KeyEvent e) rn mytank.keyPressed(e);rn //mis.keyPressed(e);rn rn rn public void keyReleased(KeyEvent e) rn mytank.keyReleased(e);rn rn rnrnrn②Tank类rnimport java.awt.Color;rnimport java.awt.Graphics;rnimport java.awt.event.KeyEvent;rnrnrnpublic class Tank rn private int x,y;rn public static final int XSPEED=5,YSPEED=5;rn public static final int TKLENGTH=30,TKWIDTH=30;rn private boolean BL,BR,BU,BD;rn TankClient tc;rn rn enum DirectionU,D,L,R,LU,RU,RD,LD,STOP; rn rn private Direction dir=Direction.STOP; rn Direction PTdir=Direction.D;rn rn public Tank(int x,int y) rn this.x=x;this.y=y;rn rn public Tank(int x,int y,TankClient tc)rn this.x=x;this.y=y;rn this.tc=tc;rn rn rn Missile fire()rn int x=this.x+Tank.TKLENGTH/2;rn int y=this.y+Tank.TKWIDTH/2;rn Missile mis=new Missile(x,y,PTdir);rn return mis;rn rn rn rn public void drawTank(Graphics g)rn rn Color c=g.getColor();rn g.setColor(Color.red);rn g.fillOval(x, y, TKLENGTH, TKWIDTH);rn g.setColor(c); rn rn//System.out.println("炮筒方向开始调用");rng.drawLine(x+Tank.TKLENGTH/2,y+Tank.TKWIDTH/2,x+Tank.TKLENGTH/2,y+Tank.TKWIDTH );rn//g.setColor(Color.black);rn switch(PTdir) rn case U: rn g.drawLine(x+Tank.TKLENGTH/2,y+Tank.TKWIDTH/2,x+Tank.TKLENGTH/2,y);rnSystem.out.println("炮筒方向开始调用--上!"); rn break;rn case D: rnSystem.out.println("炮筒方向开始调用--下!"); rng.setColor(Color.black);rn g.drawLine(x+Tank.TKLENGTH/2, y+Tank.TKWIDTH/2, x+Tank.TKLENGTH/2,y+Tank.TKWIDTH );rn rnSystem.out.println("炮筒方向调用结束--下!"); rn break;rn case L: rn g.drawLine(x+Tank.TKLENGTH/2, y+Tank.TKWIDTH/2, x,y+Tank.TKWIDTH/2 );rn rn break;rn case R: rn g.drawLine(x+Tank.TKLENGTH/2, y+Tank.TKWIDTH/2, x+Tank.TKLENGTH,y+Tank.TKWIDTH/2 );rn rn break;rn case LU: rn g.drawLine(x+Tank.TKLENGTH/2, y+Tank.TKWIDTH/2, x,y);rn break;rn case RU: rn g.drawLine(x+Tank.TKLENGTH/2, y+Tank.TKWIDTH/2, x+Tank.TKLENGTH,y );rn break;rn case RD: rn g.drawLine(x+Tank.TKLENGTH/2, y+Tank.TKWIDTH/2, x+Tank.TKLENGTH,y+Tank.TKWIDTH );rn break;rn case LD: rn g.drawLine(x+Tank.TKLENGTH/2, y+Tank.TKWIDTH/2, x,y+Tank.TKWIDTH); rn break; rn rn move();rnrn rn rn void move()rn rn switch(dir) rn rn case U: y-=XSPEED;rn break;rn case D: y+=XSPEED;rn break;rn case L: x-=XSPEED;rn break;rn case R: x+=XSPEED;rn break;rn case LU: x-=XSPEED;rn y-=XSPEED;rn break;rn case RU: x+=XSPEED;rn y-=XSPEED;rn break;rn case RD: x+=XSPEED;rn y+=XSPEED;rn break;rn case LD: x-=XSPEED;rn y+=XSPEED; rn break; rn case STOP:rn break;rn rn rn if(this.PTdir!=Direction.STOP) rn this.PTdir=this.dir;rnSystem.out.println("坦克移动方向为子弹射出方向!");rn rn rn rn public void keyPressed(KeyEvent e) rn int key=e.getKeyCode();rn switch(key)rn case KeyEvent.VK_RIGHT:rn BR=true;rn break;rn rn case KeyEvent.VK_LEFT:rn BL=true;rn break;rn rn case KeyEvent.VK_UP:rn BU=true;rn break;rn rn case KeyEvent.VK_DOWN:rn BD=true;rn break;rn case KeyEvent.VK_SPACE:rn tc.mis=fire();rn break;rn rn setLocation();rn//System.out.println(".........KeyPressed()");rn rn rn public void keyReleased(KeyEvent e) rn int key=e.getKeyCode();rn if(key==KeyEvent.VK_RIGHT)rn BR=false;rn rn if(key==KeyEvent.VK_LEFT)rn BL=false;rn rn if(key==KeyEvent.VK_UP)rn BU=false;rn rn if(key==KeyEvent.VK_DOWN)rn BD=false;rn rn rn setLocation();rn rn rn void setLocation()rn if(!BL && !BR && !BU && !BD) dir=Direction.STOP;rn else if( BL && !BR && !BU && !BD) dir=Direction.L;rn else if(!BL && BR && !BU && !BD) dir=Direction.R;rn else if(!BL && !BR && BU && !BD) dir=Direction.U;rn else if(!BL && !BR && !BU && BD) dir=Direction.D;rn else if(BL && !BR && BU && !BD) dir=Direction.LU;rn else if(BL && !BR && !BU && BD) dir=Direction.LD;rn else if(!BL && BR && BU && !BD) dir=Direction.RU;rn else if(!BL && BR && !BU && BD) dir=Direction.RD;rn//System.out.println("setLocation() 可用"); rn rn rn rn rnrnrn③Missile类:rnimport java.awt.Color;rnimport java.awt.Graphics;rnimport java.awt.event.KeyEvent;rnrnrnpublic class Missile rn int x,y; Tank.Direction dir;rn private static final int XSPEED=10;rn private static final int YSPEED=10;rn public static final int LENGTH=10;rnpublic static final int WIDTH=10;rn rnpublic Missile(int x,int y,Tank.Direction dir) rn this.x=x; this.y=y;this.dir=dir;rn rn public void drawMissile(Graphics g)rn//System.out.println("子弹drawMissile()开始调用!"); rn Color c=g.getColor();rn g.setColor(Color.black);rn g.fillOval(x, y, LENGTH, WIDTH);rn g.setColor(c); rn move();rn//System.out.println("子弹drawMissile()调用结束!");rnrn rn void move()rn//System.out.println("子弹move()开始调用!"); rn switch(dir) rn rn case U: y-=XSPEED;rn//System.out.println("子弹移动开始调用--上!"); rn break;rn case D: y+=XSPEED;rn break;rn case L: x-=XSPEED;rn break;rn case R: x+=XSPEED;rn break;rn case LU: x-=XSPEED;rn y-=XSPEED;rn break;rn case RU: x+=XSPEED;rn y-=XSPEED;rn break;rn case RD: x+=XSPEED;rn y+=XSPEED;rn break;rn case LD: x-=XSPEED;rn y+=XSPEED; rn break; rn rn rn//System.out.println("子弹move()调用结束!"); rn rn rn
求大神帮忙解决日期控件问题
string myStrYear, myStrMonth, myStrDay, myStrDay1;rn string myStrFileName = "";rn myStrYear = myDTTime.Year.ToString().Substring(2, 2);rn if (myDTTime.Month > 9)rn rn myStrMonth = myDTTime.Month.ToString();rn rn elsern rn myStrMonth = "0" + myDTTime.Month.ToString();rn rn if (myDTTime.Day > 9)rn rn myStrDay = myDTTime.Day.ToString();rn rn elsern rn myStrDay = "0" + myDTTime.Day.ToString();rn rn d = Convert.ToInt32(myStrDay) - 1;rn myStrDay1 = Convert.ToString(d);rnrn myStrFileName = myStrYear + myStrMonth + myStrDay1 ;
菜鸟求大神帮忙解决一问题
[img=https://img-bbs.csdn.net/upload/201308/06/1375718619_337215.png][/img] [img=https://img-bbs.csdn.net/upload/201308/06/1375718816_744436.png][/img]rnrn[color=#FF0000] 想要实现上图这种效果(外面蓝色那个圈随时间慢慢减少) rnrn 有大神帮忙实现吗?rnrn 最好能详细点。[/color]
算法问题,求大神帮忙解决下啊!!!
求教,要做一个交通咨询模拟,提供对城市信息进行编辑(如:添加或删除)的功能。城市之间有两种交通工具:火车和飞机。提供对列车时刻表和飞机航班进行编辑(增设或删除)的功能。提供两种最优决策:最快到达或最省钱到达。全程只考虑一种交通工具。想问算法的大体思想。谢谢!!rn
求大神帮忙解决WebView的问题
请问大神们,WebView怎么保存图片。求大神详细告知,或者别人好使的帖子。或者源码
求大神帮忙解决数据复制问题
table1结构:rnmac , state , datetime , memornrnrntable2结构:rnmac,lastlogin,lastcityrnrn请教,将table1中mac列、table1的datetime时间对应table2的lastlogin,将所有数据行插入table2。rn如果table2中mac列存在table1的mac,则只更新lastlogin。
ajax post问题,求大神帮忙解决
求大神帮忙解析这个api 中的cookies,默认phone_number为123456,password 为123456![图片说明](https://img-ask.csdn.net/upload/201511/24/1448297172_353361.png)
求大神帮忙解决一个问题
在unity中,玩家招式攻击范围正面是1.8、夹角为60度的扇形区域,其中扇形的左半部分能把NPC打晕,扇形的右半部分能把NPC打飞。现有条件:GameObject player; GameObject npc; rn请写出玩家攻击时的代码,计算出是否能击中npc,如果能击中是把npc击中,还是击飞。不要用unity的碰撞框
求大神解决下问题
我是使用form表单提交到后台,然后导出excel。现在的问题是多次点击下载导致内存溢出。因为没有返回值也不好添加遮罩层。感觉是因为tomcat的内存不足导致的。请问有什么解决方法么?
javaweb项目部署问题请大神帮忙看下
我的网站项目本来是在tomcat上的,我清除了项目后再部署就报下面的错nHttp-404nThe origin server did not find a current representation for the target resource or is not willing to disclose that one exists.n我新建的项目可以使用tomcat,但是这个却不行,这是什么原因导致的呢?该怎么解决?
JAVAWeb初学者求帮忙!
rn [color=#FF0000] 对着视频做了一个简单的管理项目,java代码中可以连上数据库,在web中,一点登录就报错没连上数据库、rn[/color]rn[img=https://img-bbs.csdn.net/upload/201511/16/1447678603_19032.png][/img]rn[img=https://img-bbs.csdn.net/upload/201511/16/1447677531_767955.png][/img]rnrnrn[color=#FF0000]已经导入了mysq的jar包,[/color][img=https://img-bbs.csdn.net/upload/201511/16/1447677597_326536.png][/img]rnrnrn[color=#FF0000]自己建了个test类是完全可以连上数据库的[/color][img=https://img-bbs.csdn.net/upload/201511/16/1447678032_879882.png][/img]rnrn[color=#FF0000]这是Login和DBUtil的代码[/color]rnpublic User login(String username,String password) rn rn rn Connection con = null;rn PreparedStatement ps = null;rn ResultSet rs = null;rn User u = null;rn try rn con = DBUtil.getConnection();rn String sql = "select * from t_user where username=?";rn ps=con.prepareStatement(sql);rn ps.setString(1, username);rn rs = ps.executeQuery();rn while(rs.next())rn rn u = new User();rn u.setId(rs.getInt("id"));rn u.setNickname(rs.getString("nickname"));rn u.setUsername(rs.getString("username"));rn u.setPassword(rs.getString("password"));rn u.setStatus(rs.getInt("status"));rn u.setType(rs.getInt("type"));rn rn if(u==null) throw new ShopException("用户名不存在");rn if(!u.getPassword().equals(password)) throw new ShopException("用户密码不正确");rn if(u.getStatus()==1) throw new ShopException("用户处于停用状态不能登录");rn catch (SQLException e) rn rn e.printStackTrace();rn rn finallyrn rn DBUtil.close(rs);rn DBUtil.close(ps);rn DBUtil.close(con);rn rn rn return u;rn rnrnrnpackage shop.util;rnrnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnrnpublic class DBUtil rn public static Connection getConnection()rn rn String username = "mrliu";rn String password = "mrliu123";rn String url = "jdbc:mysql://localhost:3306/shop";rn Connection con=null;rn try rn rn con=DriverManager.getConnection(url,username ,password );rn catch (SQLException e) rn rn e.printStackTrace();rn rn return con;rn rn rn rn public static void close(Connection con)rn if(con!=null)rn try rn con.close();rn catch (SQLException e) rn e.printStackTrace();rn rn rn rn rn public static void close(java.sql.PreparedStatement ps)rn if(ps!=null)rn try rn ps.close();rn catch (SQLException e) rn rn e.printStackTrace();rn rn rn rn public static void close(ResultSet rs)rn rn if(rs!=null)rn try rn rs.close();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rnrn
关于javaWEB分页问题(急求大神?)
分页以后,最后一页可能会出现数据不够的问题,为了美观,如何补空行,如果不补空行,比如说每页5条数据,最后一页就还剩下3条数据,那表格的高度会缩,rn求各位大神 指点
关于javaweb及数据库的问题 求助 求大神
[img=https://img-bbs.csdn.net/upload/201402/16/1392554160_222417.jpg][/img][img=https://img-bbs.csdn.net/upload/201402/16/1392554170_511020.jpg][/img][img=https://img-bbs.csdn.net/upload/201402/16/1392554185_379485.jpg][/img][img=https://img-bbs.csdn.net/upload/201402/16/1392554197_222159.jpg][/img][img=https://img-bbs.csdn.net/upload/201402/16/1392554207_625285.jpg][/img][img=https://img-bbs.csdn.net/upload/201402/16/1392554216_670649.jpg][/img][img=https://img-bbs.csdn.net/upload/201402/16/1392554225_534136.jpg][/img][img=https://img-bbs.csdn.net/upload/201402/16/1392554234_438604.jpg][/img][img=https://img-bbs.csdn.net/upload/201402/16/1392554245_393441.jpg][/img]rn数据库方面实在是不懂 java懂一点 想下载个web工程运行下 学习学习 结果 老是在注册是会出现数据库连接错误 求大神解答
求大神帮忙小童鞋,初学者遇到问题求帮忙解决
用DW5编辑网页搜索页面时,预览中出现如下代码:rnNotice: Undefined index: textfield in P:\leyou\search.php on line 224rnrn具体页面截图如下:[img=https://img-bbs.csdn.net/upload/201801/12/1515727452_860590.jpg][/img]rn[img=https://img-bbs.csdn.net/upload/201801/12/1515727511_99187.png][/img]rnrnrn具体代码如下(附代码截图[img=https://img-bbs.csdn.net/upload/201801/12/1515727631_341682.png][/img]):rnrnrnrnrnrn rnrn 搜索页rnrnrnrn rnrnrnrn rn rn rn rn 欢迎访问本网站rn rn rn rn rn rn rn rn rn rn 注册rn 登入rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn 网站首页rn 乐游动态rn 景区景点rn 旅游特产rn 旅游服务rn 乐游路线rn rn rn rn rn rn rn rn rn rn rn rn rn 搜索有关的内容是:rn rn 这里没有你要搜索的内容!rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn 乐游侨乡:乐游游乐悠悠!rn rn copyright©:乐游侨乡 版权所有!rn rn rn rn rnrnrnrnrn
js验证问题求大神帮忙
[img=https://img-bbs.csdn.net/upload/201710/19/1508379860_94330.png][/img][img=https://img-bbs.csdn.net/upload/201710/19/1508379869_472361.png][/img][img=https://img-bbs.csdn.net/upload/201710/19/1508379879_205996.png][/img]rn求大神帮忙,我js验证为什么出不来啊
求大神帮忙,js问题
var address = "";rnvar bool = false;rn//省份提交rnfunction submitMsg() rn document.getElementById("istrue").innerText="";rn var obj = document.getElementById("provinceId");rn if(obj.value=="")rn msg("提示失败","请选择省份");rn rn if(obj.value>0) rn var index = obj.selectedIndex;rn var text = obj.options[index].text;rn address += text;rn rn if(bool)rn obj.innerHTML=""+address+"";rn [b][color=#FF0000]在这里要怎么做到点击下拉框把下拉框清空,并可以重新选择[/color]我把值都追加到下拉框里去了 如果大神您不理解我的意思,可以加我QQ:824425915小弟将感激不尽[/b] rn return;rn rn createXMLHttpRequest();//先创建AJAX rn xmlHttpRequest.open("POST", "user/user_findAddress.do?value="+obj.value, true);rn xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=UTF-8");rn xmlHttpRequest.onreadystatechange = getcity;rn xmlHttpRequest.send(null); //发送参数 rn rnrnrn//获取城市列表rnvar getcity = function() rn if (xmlHttpRequest.readyState == 4) rn if (xmlHttpRequest.status == 200) rn var res = xmlHttpRequest.responseText; //获取页面传过来的值 rn var list = eval('('+res+')');rn if(list==null||list == "")rn return;rn rn var options="";rn var city = document.getElementById("provinceId");rn city.length = list.length;rn options = options+"请选择下级";rn for(var i = 0;i"+list[i].name+"";rn rn if(list[0].type=="4")rn bool = true;rn rn city.innerHTML=options;rn rn rnrnrnrn//城市提交rnfunction selectcityId() rn document.getElementById("istrue").innerText="";rn var cityId = document.getElementById("cityId").value;rn createXMLHttpRequest(); //先创建AJAX rn xmlHttpRequest.open("POST", "user/user_findAddress.do?value="+cityId, true);rn xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");rn xmlHttpRequest.onreadystatechange = getdistrict;rn xmlHttpRequest.send(null); //发送参数 rnrnrn//获取区县列表rnvar getdistrict = function() rn if (xmlHttpRequest.readyState == 4) rn if (xmlHttpRequest.status == 200) rn var data = xmlHttpRequest.responseText; //获取页面传过来的值 rn var list = eval('('+data+')');rn var townId = document.getElementById("townId");rn for(var i = 0;i"+list[i].name+"";rn rn townId.innerHTML=options;rn rn rnrnrn 请选择所在地rn rn $list.name rn rn
PortableRemoteObject.narrow问题求大神帮忙!
我在web应用里需要掉别人的EJB,但是一执行到AdminFacadeHome home =(AdminFacadeHome)PortableRemoteObject.narrow(obj,AdminFacadeHome.class)就出错,web容器是WAS7.0。奇怪的是,相同的程序不在WAS里执行却没有报错(直接通过java命令执行),有人遇到过这种情况吗?
webservice 问题,求大神帮忙
我是用JDK的wsimport方式创建的webservice,写的demo没有问题,但是一操作数据库,就报错500,但是服务端也就是简单的操作,代码肯定没有问题,还是需要配置什么东西?我是在springMVC里写的客户端与服务端,数据库mybatis,n![这是服务端,只是将传的值截取并存入name字段](https://img-ask.csdn.net/upload/201709/18/1505696719_397435.png)![这是客户端,](https://img-ask.csdn.net/upload/201709/18/1505696806_596983.png)![错误](https://img-ask.csdn.net/upload/201709/18/1505696838_411996.png)n
mschart问题求大神帮忙
各位大神mschart绘制折线图,怎样才能使十字线的交叉点始终在折线上移动。谢谢!!!
求大神帮忙找问题
关于mysql数据库的拼接查询 不知道什么原因导致数据库查询不出结果,求大神帮忙找出问题,服务器和客户端都不报错。
数据库查询问题,求大神帮忙
* 姓名 年龄 爱好n1 1 1n1 1 2nn想要查寻结果为 姓名 1 , 年龄1 ,爱好 1,爱好 2
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件