我对tomcat将我的文件部署到服务器的方式有疑问.
我已经安装了Tomcat 7 /opt/tomcat7.
在我的eclipse中,我已将此路径指定为我的tomcat服务器.
我的工作区目录是 /home/maciej/workspace/<projects here>
现在,如果我编辑一个类文件,我只添加日志语句
log.info("blabla");然后通过 - 在服务器上运行来部署文件的"新"版本,我'blabla'在输出中看不到这一点.虽然我已经修改了类文件,但它似乎没有正确部署到tomcat中.Tomcat正在阅读上帝知道什么,但肯定不是它应该阅读的文件.
编辑:我已经在eclipse中重新配置了我的tomcat,现在:
Server Path = /opt/tomcat7
Deploy Path = /opt/tomcat7/webapps <- used to be .metadata/blablabla default
eclipse tomcat location
Run Code Online (Sandbox Code Playgroud)
当我在参数/工作目录下打开"打开午餐配置"时,默认选项是带有灰色路径的票证 /home/maciej/Desktop
这应该改变吗?
是不是tomcat的工作目录/opt/tomcat7/work?
有什么建议/想法吗?由于我无法开发应用程序,因此这个问题稍微让我感到紧张.
我只是想知道你是否可以限制项目中的接口文件数量.我工作的几个项目有十几个接口没有什么特别之处,我想你能在单个文件中编写所有接口吗?并在具体类中指向所需的接口?? 即:
//interface file
interface InterfaceOne {
}
interface InterfaceTwo{
}
//foo file
public class foo implements InterfaceTwo{
public void foo {
//....
}
}
//foo1 file
public class foo1 implements InterfaceOne{
public void foo {
//....
}
}
Run Code Online (Sandbox Code Playgroud)
或类似的东西?
我在这里遇到一点问题.我在同一个故事板上有两个视图控制器(MainStoryboard - >纵向模式下的Calc视图控制器和横向模式下的Calc视图控制器).当我最初创建一个boolfor shouldAutoRotate它确实旋转然而"仍然是"一个渲染问题,因为一些按钮等不在你期望它们的位置,换句话说它们在横向模式中都到处都是.所以现在我在横向模式和主肖像模式下创建了2个视图控制器.所以现在关键是在旋转时在这两个控制器之间切换.
在CalculatorViewController.mi中有
UPDATE
我注意到一些方法从iOS 6中删除了(那就是我现在使用的那个)经过一些研究我发现在iOS 6中"有点正确的方法"就是这个
@synthesize portraitView, landscapeView;
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations:toInterfaceOrientation
{
if(UIInterfaceOrientationMaskAllButUpsideDown)
{
if ( UIInterfaceOrientationPortrait )
{
self.view = portraitView;
}
else if ( UIInterfaceOrientationLandscapeLeft )
{
self.view = landscapeView;
}
}
return YES;
}
Run Code Online (Sandbox Code Playgroud)
然而,虽然我认为我使用的是关于iOS 6的正确方法,但仍然无法在旋转时调用正确的视图控制器
并在CalculatorViewController.h中
@interface CalculatorViewController : UIViewController {
IBOutlet UIView *portraitView; // declaring view - portrait
IBOutlet UIView *landscapeView; // declaring view - landscape
//rest of irrelevant code below
}
@property (nonatomic, retain) …Run Code Online (Sandbox Code Playgroud) objective-c interface-builder uiviewcontroller screen-orientation ios
我已经使用Youtube API自动播放视频,但是我发现它只能在PC上运行,而不能在移动设备上运行。我做了一些谷歌搜索,发现在移动设备上禁用了自动播放功能。
没有问题,我可以检测是否禁用了自动播放??。如果vidio处于状态-1,则至少强制视频显示youtoube播放按钮。
即
if(event.data == -1) {
// show play button
}
Run Code Online (Sandbox Code Playgroud) 我的Actionlistener有一个小问题,当我点击按钮没有任何反应?我没有看到问题所在,所以另一双眼睛可以帮助我:)
public class GameOptions extends JPanel implements ActionListener{
public GameOptions(){
System.out.println("GameOptions Class test blabla");
easyButton().addActionListener(this);
mediumButton().addActionListener(this);
hardButton().addActionListener(this);
JPanel center = new JPanel(new GridLayout(4,1,10,10));
center.add(new JLabel("Chose Difficulty Level"));
center.add(easyButton());
center.add(mediumButton());
center.add(hardButton());
this.add(center, BorderLayout.CENTER);
this.setPreferredSize(this.getPreferredSize());
this.setFocusable(true);
this.requestFocusInWindow();
}
private JButton easyButton(){
JButton levelEasy = new JButton("Easy");
return levelEasy;
}
private JButton mediumButton(){
JButton levelMedium = new JButton("Medium");
return levelMedium;
}
private JButton hardButton(){
JButton levelHard = new JButton("Hard");
return levelHard;
}
@Override
public void actionPerformed(ActionEvent e) {
Object src = e.getSource();
if(src …Run Code Online (Sandbox Code Playgroud) 我是bash脚本的新手,所以请放轻松我;).
我有一个文件在启动发送电子邮件的/ warner文件之前会进行一些检查.
不,脚本应该做的是:
如果要在日志文件中找到"rror"一词,如果文件较年轻,那么24小时>发送失败的电子邮件
如果文件超过24小时>发送未运行错误
如果以上都不是真的并且文件少于24小时,并且如果它包含单词'uccess'>发送成功的电子邮件.
自己编写脚本
string=rror
string1=ucces
FILE=/var/log/rsnapshot.log
OLDTIME=86400
CURTIME=$(date +%s)
FILETIME=$(stat $FILE -c %Y)
TIMEDIFF=$(expr $CURTIME - $FILETIME)
#tail -n0 -F /var/log/rsnapshot.log | \
while read LINE
do
if [ echo "$LINE" | grep "$string" 1>/dev/null 2>&1 -a $TIMEDIFF -lt $OLDTIME ]; // <- line 18
then
/etc/init.d/warner "Warning from Socrates Backup" "Backup Failed"
elif [ $TIMEDIFF -gt $OLDTIME ];
then
/etc/init.d/warner "Warning from Socrates Backup - Backup Not Running!" "Backup file not running"
elif echo …Run Code Online (Sandbox Code Playgroud) 我收到一个我不完全理解的错误,为什么会出现?
我有一个表单,我在其中输入相关JTextBoxes的详细信息,这些文本框中的数据应该发送到我在本地设置的数据库.
完整的错误消息
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException. You have an error in your
SQL syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near ')VALUES'asd','asd',",",",",",",'Home','Female','White
British' at line 1
Run Code Online (Sandbox Code Playgroud)
码
conn = (Connection) SQLConnect.ConnectDb();
//inserting all values to database
String sql = "INSERT INTO w1283057.criminalrecords "
+ "(FName, MName, Sname, DOB, Address, HPhone, BPhone, MPhone "
+ "ResidentStatus, Sex, Race, IncidentLocation, Zone, PremiseType "
+ "DateRecorded, TimeRecorded, Weapons, CrimeOffences) "
+ "VALUES (?, ?, ?, …Run Code Online (Sandbox Code Playgroud) java ×3
ios ×2
android ×1
bash ×1
database ×1
eclipse ×1
if-statement ×1
interface ×1
javascript ×1
jbutton ×1
linux ×1
mysql ×1
objective-c ×1
shell ×1
swing ×1
tomcat ×1
youtube-api ×1